Package com.venafi.vcert.sdk.certificate
Class PEMCollection
- java.lang.Object
-
- com.venafi.vcert.sdk.certificate.PEMCollection
-
public class PEMCollection extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPEMCollection.RawPrivateKey
-
Field Summary
Fields Modifier and Type Field Description static StringBOUNCY_CASTLE_ENCRYPTION_ALGORITHMstatic StringCIPHER_TRANSFORMATIONstatic StringSECRET_KEY_ALGORITHMstatic StringSECRET_KEY_FACTORY_ALGORITHMstatic intSECRET_KEY_LENGTH_BITS
-
Constructor Summary
Constructors Constructor Description PEMCollection()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrivateKeydecryptPKCS8PrivateKey(org.bouncycastle.openssl.PEMParser pemParser, String keyPassword)byte[]derCertificate()List<byte[]>derCertificateChain()PEMCollection.RawPrivateKeyderPrivateKey()static PEMCollectionfromResponse(String body, ChainOption chainOption, PrivateKey privateKey, String privateKeyPassword)static SecretKeySpecpasswordToCipherSecretKey(char[] password, byte[] iv)StringpemCertificate()StringpemCertificateChain()StringpemPrivateKey()byte[]toJks(String password)byte[]toPkcs12(String password)
-
-
-
Field Detail
-
BOUNCY_CASTLE_ENCRYPTION_ALGORITHM
public static final String BOUNCY_CASTLE_ENCRYPTION_ALGORITHM
- See Also:
- Constant Field Values
-
CIPHER_TRANSFORMATION
public static final String CIPHER_TRANSFORMATION
- See Also:
- Constant Field Values
-
SECRET_KEY_FACTORY_ALGORITHM
public static final String SECRET_KEY_FACTORY_ALGORITHM
- See Also:
- Constant Field Values
-
SECRET_KEY_ALGORITHM
public static final String SECRET_KEY_ALGORITHM
- See Also:
- Constant Field Values
-
SECRET_KEY_LENGTH_BITS
public static final int SECRET_KEY_LENGTH_BITS
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromResponse
public static PEMCollection fromResponse(String body, ChainOption chainOption, PrivateKey privateKey, String privateKeyPassword) throws VCertException
- Throws:
VCertException
-
pemCertificate
public String pemCertificate()
-
pemPrivateKey
public String pemPrivateKey()
-
pemCertificateChain
public String pemCertificateChain()
-
derCertificate
public byte[] derCertificate()
-
derPrivateKey
public PEMCollection.RawPrivateKey derPrivateKey()
-
derCertificateChain
public List<byte[]> derCertificateChain()
-
toPkcs12
public byte[] toPkcs12(String password) throws org.bouncycastle.pkcs.PKCSException
- Throws:
org.bouncycastle.pkcs.PKCSException
-
toJks
public byte[] toJks(String password) throws KeyStoreException, CertificateException
-
passwordToCipherSecretKey
public static SecretKeySpec passwordToCipherSecretKey(char[] password, byte[] iv) throws NoSuchAlgorithmException, InvalidKeySpecException
-
decryptPKCS8PrivateKey
public static PrivateKey decryptPKCS8PrivateKey(org.bouncycastle.openssl.PEMParser pemParser, String keyPassword) throws IOException, org.bouncycastle.operator.OperatorCreationException, org.bouncycastle.pkcs.PKCSException
- Throws:
IOExceptionorg.bouncycastle.operator.OperatorCreationExceptionorg.bouncycastle.pkcs.PKCSException
-
-