CryptoUtil and CertificateUtils instead.@Deprecated public class BouncyCastleUtils extends Object
CryptoUtil or CertificateUtils class, so use those methods instead.| Constructor and Description |
|---|
BouncyCastleUtils()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
base64Decode(String string)
Deprecated.
base64Decode.
|
static String |
base64Encode(byte[] bytes)
Deprecated.
base64Encode.
|
static X509Certificate |
generateCertificate(String domainName,
PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
Date from,
Date to,
BigInteger serial,
String applicationUri,
String... hostNames)
Deprecated.
Generates a new certificate using the Bouncy Castle implementation.
|
static X509Certificate |
generateIssuerCert(PublicKey publicKey,
PrivateKey privateKey,
KeyPair issuerKeys,
String commonName,
BigInteger serialNr,
Date startDate,
Date expiryDate)
Deprecated.
Build a X509 V3 certificate to use as an issuer (CA) certificate.
|
static Collection<List<?>> |
getSubjectAlternativeNames(X509Certificate cert)
Deprecated.
getSubjectAlternativeNames.
|
static byte[] |
PKCS5PasswordToBytes(char[] password)
Deprecated.
Converts a password to a byte array according to the scheme in PKCS5 (ascii, no padding).
|
static void |
writeToPem(Object key,
File savePath,
String password,
String algorithm)
Deprecated.
Write a certificate or private key to a PEM file with a password.
|
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 generateCertificate(String domainName, PublicKey publicKey, PrivateKey privateKey, KeyPair issuerKeys, Date from, Date to, BigInteger serial, String applicationUri, String... hostNames) throws IOException, GeneralSecurityException
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 timeserial - a BigInteger object.applicationUri - the OPC UA ApplicationUri of the application - added to
SubjectAlternativeNamehostNames - the additional host names to ass to SubjectAlternativeNameGeneralSecurityException - if the generation failsIOException - if the generation fails due to an IO exceptionpublic static X509Certificate generateIssuerCert(PublicKey publicKey, PrivateKey privateKey, KeyPair issuerKeys, String commonName, BigInteger serialNr, 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.commonName - the CommonName to use for the subject of the certificate.serialNr - a BigInteger object.startDate - a Date object.expiryDate - a Date object.X509Certificate object.GeneralSecurityException - if any.IOException - if any.public static Collection<List<?>> getSubjectAlternativeNames(X509Certificate cert) throws CertificateParsingException
getSubjectAlternativeNames.
cert - a X509Certificate object.Collection object.CertificateParsingException - if any.public static byte[] PKCS5PasswordToBytes(char[] password)
password - a character array representing the password.public static void writeToPem(Object key, File savePath, String password, String algorithm) throws IOException
Write a certificate or private key to a PEM file with a password.
key - certificate of private keysavePath - a File object.password - a String object.algorithm - a String object.FileNotFoundException - if any.IOException - if any.Copyright © 2026. All rights reserved.