public class CertUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[][] |
buildDERCertChain(Certificate[] certChain)
Converts a java Certificate Chain to a der encoded byte array.
|
static int |
computeJavaPrivateKeySize(PrivateKey privateKey)
Computes the size of a JCE PrivateKey
|
static PrivateKey |
createJCEPrivateKey(byte[] encodedPriKey,
String keyWrappingFormat)
Create a JCE PrivateKey given a DER encoded set of bytes representing the key.
|
static PrivateKeyHolder |
createJCEPrivateKeyHolder(byte[] encodedPriKey,
String keyWrappingFormat)
Create a JCE PrivateKey given a DER encoded set of bytes representing the key.
|
static String |
getCommonSubjectName(X509Certificate x509Certificate)
Returns value of "CN" attribute from subject name of this certificate.
|
static Certificate |
importCertificate(byte[] certData)
Creates a JCE X509 certificate from a DER encoded byte array representing the certificate.
|
static Certificate[] |
importCertificateChain(byte[][] certData)
Creates a JCE X509 certificate chain from a DER encoded byte array representing the cert chain
|
public static Certificate importCertificate(byte[] certData) throws CertificateException, IOException
certData - CertificateExceptionIOExceptionpublic static Certificate[] importCertificateChain(byte[][] certData) throws CertificateException, IOException
certData - CertificateExceptionIOExceptionpublic static PrivateKey createJCEPrivateKey(byte[] encodedPriKey, String keyWrappingFormat) throws NoSuchAlgorithmException, InvalidKeySpecException
encodedPriKey - keyWrappingFormat - NoSuchAlgorithmExceptionInvalidKeySpecExceptionpublic static PrivateKeyHolder createJCEPrivateKeyHolder(byte[] encodedPriKey, String keyWrappingFormat) throws NoSuchAlgorithmException, InvalidKeySpecException
encodedPriKey - keyWrappingFormat - NoSuchAlgorithmExceptionInvalidKeySpecExceptionpublic static byte[][] buildDERCertChain(Certificate[] certChain) throws CertificateEncodingException, CertificateException
certChain - CertificateEncodingExceptionCertificateExceptionpublic static int computeJavaPrivateKeySize(PrivateKey privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException
privateKey - NoSuchAlgorithmExceptionInvalidKeySpecExceptionpublic static String getCommonSubjectName(X509Certificate x509Certificate)
x509Certificate - Copyright © 2010 - 2020 Adobe. All Rights Reserved