Class RsaSha256CertificateFactory
java.lang.Object
org.eclipse.milo.opcua.stack.core.security.RsaSha256CertificateFactory
- All Implemented Interfaces:
CertificateFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCertificateChain(NodeId certificateTypeId, KeyPair keyPair) Create aX509Certificatechain for the certificate of the type identified bycertificateTypeId.createKeyPair(NodeId certificateTypeId) Create aKeyPairfor the certificate of the type identified bycertificateTypeId.protected abstract X509Certificate[]createRsaSha256CertificateChain(KeyPair keyPair) Create a newX509Certificatechain of typeNodeIds0.RsaSha256ApplicationCertificateType.protected KeyPairCreate a newKeyPairfor aNodeIds0.RsaSha256ApplicationCertificateTypetype certificate.protected ByteStringcreateRsaSha256SigningRequest(KeyPair keyPair, org.bouncycastle.asn1.x500.X500Name subjectName, String sanUri, List<String> dnsNames, List<String> ipAddresses) Create a new PKCS10 certificate signing request for aNodeIds0.RsaSha256ApplicationCertificateTypetype certificate.createSigningRequest(NodeId certificateTypeId, KeyPair keyPair, org.bouncycastle.asn1.x500.X500Name subjectName, String sanUri, List<String> dnsNames, List<String> ipAddresses) Create a PKCS10 certificate signing request for the certificate of the type identified bycertificateTypeId.
-
Constructor Details
-
RsaSha256CertificateFactory
public RsaSha256CertificateFactory()
-
-
Method Details
-
createKeyPair
Description copied from interface:CertificateFactoryCreate aKeyPairfor the certificate of the type identified bycertificateTypeId.- Specified by:
createKeyPairin interfaceCertificateFactory- Parameters:
certificateTypeId- theNodeIdidentifying the type of certificate.- Returns:
- the new
KeyPair. - Throws:
NoSuchAlgorithmException
-
createCertificateChain
public X509Certificate[] createCertificateChain(NodeId certificateTypeId, KeyPair keyPair) throws Exception Description copied from interface:CertificateFactoryCreate aX509Certificatechain for the certificate of the type identified bycertificateTypeId.- Specified by:
createCertificateChainin interfaceCertificateFactory- Parameters:
certificateTypeId- theNodeIdidentifying the type of certificate.keyPair- theKeyPairto use when creating the certificate chain.- Returns:
- the new
X509Certificatechain. - Throws:
Exception
-
createSigningRequest
public ByteString createSigningRequest(NodeId certificateTypeId, KeyPair keyPair, org.bouncycastle.asn1.x500.X500Name subjectName, String sanUri, List<String> dnsNames, List<String> ipAddresses) throws Exception Description copied from interface:CertificateFactoryCreate a PKCS10 certificate signing request for the certificate of the type identified bycertificateTypeId.- Specified by:
createSigningRequestin interfaceCertificateFactory- Parameters:
certificateTypeId- theNodeIdidentifying the type of certificate.keyPair- theKeyPairto use when creating the signing request.subjectName- theX500Nameto request.sanUri- the URI to request in the Subject Alternative Name of the CSR.dnsNames- the DNS names to request in the Subject Alternative Name of the CSR.ipAddresses- the IP addresses to request in the Subject Alternative Name of the CSR.- Returns:
- the new
ByteStringcontaining the DER-encoded PKCS10 signing request. - Throws:
Exception- if an error occurs while creating the signing request.
-
createRsaSha256KeyPair
Create a newKeyPairfor aNodeIds0.RsaSha256ApplicationCertificateTypetype certificate. The key length must be between 2048 and 4096 bits.- Returns:
- the new
KeyPair. - Throws:
NoSuchAlgorithmException
-
createRsaSha256CertificateChain
protected abstract X509Certificate[] createRsaSha256CertificateChain(KeyPair keyPair) throws Exception Create a newX509Certificatechain of typeNodeIds0.RsaSha256ApplicationCertificateType. The chain may be of length 1 if the certificate is self-signed.- Parameters:
keyPair- theKeyPairto use when creating the certificate chain.- Returns:
- the new
X509Certificatechain. - Throws:
Exception- if an error occurs while creating the certificate chain.
-
createRsaSha256SigningRequest
protected ByteString createRsaSha256SigningRequest(KeyPair keyPair, org.bouncycastle.asn1.x500.X500Name subjectName, String sanUri, List<String> dnsNames, List<String> ipAddresses) throws Exception Create a new PKCS10 certificate signing request for aNodeIds0.RsaSha256ApplicationCertificateTypetype certificate.- Parameters:
keyPair- theKeyPairto use when creating the signing request.subjectName- theX500Nameto request.sanUri- the URI to request in the Subject Alternative Name of the CSR.dnsNames- the DNS names to request in the Subject Alternative Name of the CSR.ipAddresses- the IP addresses to request in the Subject Alternative Name of the CSR.- Returns:
- the new
ByteStringcontaining the DER-encoded PKCS10 signing request. - Throws:
Exception- if an error occurs while creating the signing request.
-