-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CertificateType attribute to CertificateRequest
- Loading branch information
Henrik Oehmke
authored and
Henrik Oehmke
committed
Sep 26, 2022
1 parent
41bde09
commit a04ab11
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/venafi/vcert/sdk/certificate/CertificateType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.venafi.vcert.sdk.certificate; | ||
|
||
|
||
import lombok.Getter; | ||
|
||
public enum CertificateType { | ||
Auto("Auto"), | ||
CodeSigning("Code Signing"), | ||
Device("Device"), | ||
Server("Server"), | ||
User("User"); | ||
|
||
public static CertificateType from(String value) { | ||
switch (value.toLowerCase()) { | ||
case "auto": | ||
return Auto; | ||
case "code signing": | ||
return CodeSigning; | ||
case "device": | ||
return Device; | ||
case "server": | ||
return Server; | ||
case "user": | ||
return User; | ||
default: | ||
throw new IllegalArgumentException(String.format("unknown certificate type: %s", value)); | ||
} | ||
} | ||
|
||
@Getter | ||
private final String value; | ||
|
||
CertificateType(String value) { | ||
this.value = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters