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
- CertificateException
IOException
public static Certificate[] importCertificateChain(byte[][] certData) throws CertificateException, IOException
certData
- CertificateException
IOException
public static PrivateKey createJCEPrivateKey(byte[] encodedPriKey, String keyWrappingFormat) throws NoSuchAlgorithmException, InvalidKeySpecException
encodedPriKey
- keyWrappingFormat
- NoSuchAlgorithmException
InvalidKeySpecException
public static PrivateKeyHolder createJCEPrivateKeyHolder(byte[] encodedPriKey, String keyWrappingFormat) throws NoSuchAlgorithmException, InvalidKeySpecException
encodedPriKey
- keyWrappingFormat
- NoSuchAlgorithmException
InvalidKeySpecException
public static byte[][] buildDERCertChain(Certificate[] certChain) throws CertificateEncodingException, CertificateException
certChain
- CertificateEncodingException
CertificateException
public static int computeJavaPrivateKeySize(PrivateKey privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException
privateKey
- NoSuchAlgorithmException
InvalidKeySpecException
public static String getCommonSubjectName(X509Certificate x509Certificate)
x509Certificate
- Copyright © 2010 - 2020 Adobe. All Rights Reserved