|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.utils.SunJceUtils
public class SunJceUtils
SunJCE specific implementations of certain Crypto Utilities.
Called normally from the CryptoUtil or CertificateUtils class,
so use those methods instead.
| Constructor Summary | |
|---|---|
SunJceUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
base64Decode(String string)
base64Decode. |
static String |
base64Encode(byte[] bytes)
base64Encode. |
static X509Certificate |
generateCertificate(String domainName,
PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
Date from,
Date to,
BigInteger serialNumber,
String applicationUri,
String... hostNames)
Generates a new certificate using the Sun implementation. |
static X509Certificate |
generateIssuerCert(PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
String domainName,
BigInteger serialNumber,
Date startDate,
Date expiryDate)
Build a X509 V3 certificate to use as an issuer (CA) certificate. |
static Collection<List<?>> |
getSubjectAlternativeNames(X509Certificate cert)
getSubjectAlternativeNames. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SunJceUtils()
| Method Detail |
|---|
public static byte[] base64Decode(String string)
base64Decode.
string - a String object.
public static String base64Encode(byte[] bytes)
base64Encode.
bytes - an array of byte.
String object.
public static X509Certificate generateIssuerCert(PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
String domainName,
BigInteger serialNumber,
Date startDate,
Date expiryDate)
throws GeneralSecurityException,
IOException
publicKey - the public key to use for the certificateprivateKey - the private key corresponding to the publicKeyissuerKeys - the certificate and private key of the certificate issuer: if
null a self-signed certificate is created.domainName - the CommonName to use for the subject of the certificate.serialNumber - a BigInteger object.startDate - a Date object.expiryDate - a Date object.
X509Certificate object.
GeneralSecurityException - if any.
IOException - if any.
public static X509Certificate generateCertificate(String domainName,
PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
Date from,
Date to,
BigInteger serialNumber,
String applicationUri,
String... hostNames)
throws GeneralSecurityException,
IOException
The method is used from
CertificateUtils.createApplicationInstanceCertificate(String, String, String, int, String...)
and
CertificateUtils.renewApplicationInstanceCertificate(String, String, String, int, org.opcfoundation.ua.transport.security.KeyPair, String...)
domainName - the X500 domain name for the certificatepublicKey - the public key of the certprivateKey - the private key of the certissuerKeys - the certificate and private key of the issuerfrom - validity start timeto - validity end timeserialNumber - a unique serial number for the certificateapplicationUri - the OPC UA ApplicationUri of the application - added to
SubjectAlternativeNamehostNames - the additional host names to ass to SubjectAlternativeName
GeneralSecurityException - if the generation fails
IOException - if the generation fails due to an IO exception
public static Collection<List<?>> getSubjectAlternativeNames(X509Certificate cert)
throws CertificateParsingException
getSubjectAlternativeNames.
cert - a X509Certificate object.
Collection object.
CertificateParsingException - if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||