|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nhindirect.config.manager.printers.CertUtils
public class CertUtils
| Constructor Summary | |
|---|---|
CertUtils()
|
|
| Method Summary | |
|---|---|
static X509Certificate |
certFromFile(String certFile)
Creates an X509Certificate object from an existing file. |
static byte[] |
pkcs12ToStrippedPkcs12(byte[] bytes,
String passphrase)
Takes a PKCS12 byte stream and returns a PKCS12 byte stream with the pass phrase protection and encryption removed. |
static X509Certificate |
toX509Certificate(byte[] data)
Converts a byte stream to an X509Certificate. |
static X509Certificate |
toX509Certificate(byte[] data,
String passPhrase)
Converts a byte stream to an X509Certificate. |
static byte[] |
x509CertificateToBytes(X509Certificate cert)
Converts an X509Certificate to a byte stream representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CertUtils()
| Method Detail |
|---|
public static byte[] pkcs12ToStrippedPkcs12(byte[] bytes,
String passphrase)
throws org.nhindirect.dns.DNSException
bytes - The PKCS12 byte stream that will be stripped.passphrase - The pass phrase of the PKCS12 byte stream. This is used to decrypt the PKCS12 stream.
org.nhindirect.dns.DNSException
public static byte[] x509CertificateToBytes(X509Certificate cert)
throws org.nhindirect.dns.DNSException
cert - The certificate to convert.
org.nhindirect.dns.DNSException
public static X509Certificate toX509Certificate(byte[] data)
throws org.nhindirect.dns.DNSException
If the stream is a PKCS12 representation, then an empty ("") pass phrase is used to decrypt the stream. In addition the resulting X509Certificate implementation will contain the private key.
data - The byte stream representation to convert.
org.nhindirect.dns.DNSException
public static X509Certificate toX509Certificate(byte[] data,
String passPhrase)
throws org.nhindirect.dns.DNSException
If the stream is a PKCS12 representation, then the pass phrase is used to decrypt the stream. In addition the resulting X509Certificate implementation will contain the private key.
data - The byte stream representation to convert.passPhrase - If the byte stream is a PKCS12 representation, then the then the pass phrase is used to decrypt the stream. Can be
null if the stream is an encoded X509Certificate and not a PKCS12 byte stream.
org.nhindirect.dns.DNSExceptionpublic static X509Certificate certFromFile(String certFile)
certFile - The file to load into a certificate object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||