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
-
-
-
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
Deprecated.UsefromStringPEMCollection(String, ChainOption, PrivateKey, String)instead of it.- Parameters:
body-chainOption-privateKey-privateKeyPassword-- Returns:
- Throws:
VCertException
-
fromStringPEMCollection
public static PEMCollection fromStringPEMCollection(String stringPemCollection, ChainOption chainOption, PrivateKey privateKey, String privateKeyPassword) throws VCertException
- Throws:
VCertException
-
fromStringPEMCollection
public static PEMCollection fromStringPEMCollection(String stringPemCollection, ChainOption chainOption, PrivateKey privateKey, String privateKeyPassword, DataFormat dataFormat) 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
-
decryptPKCS8PrivateKey
public static PrivateKey decryptPKCS8PrivateKey(org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo encryptedPrivateKeyInfo, String keyPassword) throws org.bouncycastle.openssl.PEMException, org.bouncycastle.operator.OperatorCreationException, org.bouncycastle.pkcs.PKCSException
- Throws:
org.bouncycastle.openssl.PEMExceptionorg.bouncycastle.operator.OperatorCreationExceptionorg.bouncycastle.pkcs.PKCSException
-
-