ICipherSuitepublic interface IAsymmetricCipherSuite extends ICipherSuite
| Modifier and Type | Method | Description |
|---|---|---|
org.bouncycastle.cert.X509AttributeCertificateHolder |
createAttributeCert(java.security.cert.X509Certificate clientCert,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
java.lang.String attributeId,
java.lang.String attributeValue) |
Generate an Attribute Certificate.
|
java.security.cert.X509Certificate |
createCert(java.lang.String subjectRfc822AlternativeName,
java.security.PublicKey pubKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType) |
Generate an end user certificate.
|
java.security.cert.X509Certificate |
createCert(org.bouncycastle.asn1.x509.GeneralName[] subjectAlternativeNames,
java.security.PublicKey pubKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType) |
Generate an end user certificate.
|
java.security.cert.X509Certificate |
createCert(org.bouncycastle.asn1.x509.GeneralName[] subjectAlternativeNames,
org.bouncycastle.pkcs.PKCS10CertificationRequest csr,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType) |
Generate an end user certificate from a CSR.
|
org.bouncycastle.pkcs.PKCS10CertificationRequest |
createCSR(org.bouncycastle.asn1.x500.X500Name subject,
java.security.PublicKey publicKey,
java.security.PrivateKey privateKey,
org.bouncycastle.asn1.x509.GeneralName[] subjectAlternateNames) |
|
java.security.cert.X509Certificate |
createMasterCert(java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.math.BigInteger serialNumber) |
Generate a Master, self signed certificate.
|
java.security.cert.X509Certificate |
createSelfSignedCert(java.security.KeyPair keyPair,
org.bouncycastle.asn1.x500.X500Name subject,
int validDays) |
Create a self signed certificate for the given principal.
|
java.security.KeyPair |
generateKeyPair() |
|
AsymmetricCipher |
getId() |
Get the unique ID for this cipher suite.
|
int |
getKeySize(java.security.PrivateKey key) |
|
int |
getKeySize(java.security.PublicKey key) |
|
java.lang.String |
getSignatureAlgorithm() |
Return the name of the SignatureAlgorithm used by this CipherSuite.
|
java.security.PrivateKey |
privateKeyFromDER(java.lang.String der) |
|
java.lang.String |
privateKeyToDER(java.security.PrivateKey key) |
|
java.security.PublicKey |
publicKeyFromDER(java.lang.String der) |
|
java.lang.String |
publicKeyToDER(java.security.PublicKey key) |
|
byte[] |
sign(byte[] data,
java.security.PrivateKey privateKey) |
Sign the given data.
|
java.lang.String |
sign(java.lang.String data,
java.security.PrivateKey privateKey) |
Sign the given data and return a base64 encoded string of the signature.
|
javax.crypto.SecretKey |
unwrap(byte[] cipherText,
java.security.PrivateKey userPrivateKey,
ISymmetricCipherSuite symmetricCipherSuite) |
Unwrap the given encrypted SecretKey
|
void |
validateKey(java.security.KeyPair keyPair) |
Validate the given KeyPair and throw an exception if it is not suitable for
use with this CipherSuite.
|
void |
validateKey(java.security.PrivateKey key) |
Validate the given key and throw an exception if it is not suitable for
use with this CipherSuite.
|
void |
validateKey(java.security.PublicKey key) |
Validate the given key and throw an exception if it is not suitable for
use with this CipherSuite.
|
void |
verifySignature(byte[] encodedSignature,
byte[] data,
java.security.cert.Certificate certificate) |
|
void |
verifySignature(byte[] encodedSignature,
byte[] data,
java.security.PublicKey publicKey) |
|
byte[] |
wrap(javax.crypto.SecretKey key,
java.security.PublicKey userKey) |
Wrap the given symmetric key by encrypting with the given user's public key.
|
getCipher, getKeyAlgorithm, getKeySizeAsymmetricCipher getId()
void validateKey(java.security.KeyPair keyPair)
throws java.security.InvalidKeyException
keyPair - A KeyPair to validate.java.security.InvalidKeyException - If the given KeyPair is incompatible with the
current CipherSuite.void validateKey(java.security.PrivateKey key)
throws java.security.InvalidKeyException
key - A key to validate.java.security.InvalidKeyException - If the given KeyPair is incompatible with the
current CipherSuite.void validateKey(java.security.PublicKey key)
throws java.security.InvalidKeyException
key - A key to validate.java.security.InvalidKeyException - If the given KeyPair is incompatible with the
current CipherSuite.java.lang.String getSignatureAlgorithm()
org.bouncycastle.pkcs.PKCS10CertificationRequest createCSR(org.bouncycastle.asn1.x500.X500Name subject,
java.security.PublicKey publicKey,
java.security.PrivateKey privateKey,
org.bouncycastle.asn1.x509.GeneralName[] subjectAlternateNames)
throws org.bouncycastle.operator.OperatorCreationException,
java.io.IOException
org.bouncycastle.operator.OperatorCreationExceptionjava.io.IOExceptionjava.security.KeyPair generateKeyPair()
java.security.cert.X509Certificate createSelfSignedCert(java.security.KeyPair keyPair,
org.bouncycastle.asn1.x500.X500Name subject,
int validDays)
throws java.security.InvalidKeyException
keyPair - The public key to be associate with the certificate and the private key to
sign the certificate with.subject - Subject principal.validDays - Number of days from now for which the certificate will be valid.java.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.byte[] sign(byte[] data,
java.security.PrivateKey privateKey)
throws java.security.InvalidKeyException
data - Data to be signedprivateKey - Signing key.java.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.java.lang.String sign(java.lang.String data,
java.security.PrivateKey privateKey)
throws java.security.InvalidKeyException
data - Data to be signedprivateKey - Private signing key.java.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.void verifySignature(byte[] encodedSignature,
byte[] data,
java.security.cert.Certificate certificate)
throws SignatureVerificationException
SignatureVerificationExceptionvoid verifySignature(byte[] encodedSignature,
byte[] data,
java.security.PublicKey publicKey)
throws SignatureVerificationException
SignatureVerificationExceptionjava.security.cert.X509Certificate createMasterCert(java.security.PublicKey pubKey,
java.security.PrivateKey privKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.math.BigInteger serialNumber)
pubKey - Public key for principal.privKey - Private key for principal, used to sign the certificate.principal - The subject of the certificate.notBefore - Validity start date.notAfter - Validity end date.ocspUrl - If non-null then this is added as the OCSP URL for the certificate.serialNumber - Certificate serial number, should be unique for this CA.java.security.cert.X509Certificate createCert(java.lang.String subjectRfc822AlternativeName,
java.security.PublicKey pubKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType)
throws java.security.InvalidKeyException
subjectRfc822AlternativeName - If non-null then this is added as the subject's email addresspubKey - Public key for principal.principal - The subject of the certificate.notBefore - Validity start date.notAfter - Validity end date.ocspUrl - If non-null then this is added as the OCSP URL for the certificate.caPrivKey - Private key for the CA, used to sign the certificate.caCert - The certificate relating to the caPrivKeyserialNumber - Certificate serial number, should be unique for this CA.policyOid - Optional OID for certificate policy, needs policyUrl as well.policyUrl - Optional URL for certificate policy, needs policyOid as well.certificateType - Type of certificate required, one of
UserEncryption, UserSigning or Serverjava.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.java.security.cert.X509Certificate createCert(org.bouncycastle.asn1.x509.GeneralName[] subjectAlternativeNames,
java.security.PublicKey pubKey,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType)
throws java.security.InvalidKeyException
subjectAlternativeNames - If non-null then this array of GeneralName is added as the subject's alternative names.pubKey - Public key for principal.principal - The subject of the certificate.notBefore - Validity start date.notAfter - Validity end date.ocspUrl - If non-null then this is added as the OCSP URL for the certificate.caPrivKey - Private key for the CA, used to sign the certificate.caCert - The certificate relating to the caPrivKeyserialNumber - Certificate serial number, should be unique for this CA.policyOid - Optional OID for certificate policy, needs policyUrl as well.policyUrl - Optional URL for certificate policy, needs policyOid as well.certificateType - Type of certificate required, one of
UserEncryption, UserSigning or Serverjava.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.java.security.cert.X509Certificate createCert(org.bouncycastle.asn1.x509.GeneralName[] subjectAlternativeNames,
org.bouncycastle.pkcs.PKCS10CertificationRequest csr,
org.bouncycastle.asn1.x500.X500Name principal,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
CertType certificateType)
throws java.security.InvalidKeyException,
SignatureVerificationException
subjectAlternativeNames - If non-null then this array of GeneralName is added as the subject's alternative names.csr - A Certificate Signing Requestprincipal - The subject of the certificate, if null then the subject in the CSR is used.notBefore - Validity start date.notAfter - Validity end date.ocspUrl - If non-null then this is added as the OCSP URL for the certificate.caPrivKey - Private key for the CA, used to sign the certificate.caCert - The certificate relating to the caPrivKeyserialNumber - Certificate serial number, should be unique for this CA.policyOid - Optional OID for certificate policy, needs policyUrl as well.policyUrl - Optional URL for certificate policy, needs policyOid as well.certificateType - Type of certificate required, one of
UserEncryption, UserSigning or Serverjava.security.InvalidKeyException - If the given keys are incompatible with this CipherSuite.SignatureVerificationException - If the CSR signature is not valid or cannot ve verified.org.bouncycastle.cert.X509AttributeCertificateHolder createAttributeCert(java.security.cert.X509Certificate clientCert,
java.util.Date notBefore,
java.util.Date notAfter,
java.net.URL ocspUrl,
java.security.PrivateKey caPrivKey,
java.security.cert.X509Certificate caCert,
java.math.BigInteger serialNumber,
java.lang.String policyOid,
java.net.URL policyUrl,
java.lang.String attributeId,
java.lang.String attributeValue)
clientCert - User certificate for which this attribute applies.notBefore - Validity start date.notAfter - Validity end date.ocspUrl - If non-null then this is added as the OCSP URL for the certificate.caPrivKey - Private key for the CA, used to sign the certificate.caCert - The certificate relating to the caPrivKeyserialNumber - Certificate serial number, should be unique for this CA.policyOid - Optional OID for certificate policy, needs policyUrl as well.policyUrl - Optional URL for certificate policy, needs policyOid as well.attributeId - OID of the attribute.attributeValue - Value of the attribute.byte[] wrap(javax.crypto.SecretKey key,
java.security.PublicKey userKey)
throws java.security.GeneralSecurityException
key - Key to be wrapped.userKey - Public key of user for whom it is wrapped. Only they can unwrap using their secret key.java.security.GeneralSecurityExceptionjavax.crypto.SecretKey unwrap(byte[] cipherText,
java.security.PrivateKey userPrivateKey,
ISymmetricCipherSuite symmetricCipherSuite)
throws java.security.GeneralSecurityException
cipherText - Encrypted key to be unwrapped.userPrivateKey - Wrapping key.symmetricCipherSuite - Wrapping cipherSuitejava.security.GeneralSecurityExceptionjava.lang.String publicKeyToDER(java.security.PublicKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionjava.security.PublicKey publicKeyFromDER(java.lang.String der)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionjava.lang.String privateKeyToDER(java.security.PrivateKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionjava.security.PrivateKey privateKeyFromDER(java.lang.String der)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionint getKeySize(java.security.PublicKey key)
throws java.security.InvalidKeyException
java.security.InvalidKeyExceptionint getKeySize(java.security.PrivateKey key)
throws java.security.InvalidKeyException
java.security.InvalidKeyExceptionCopyright © 2018 Symphony Software Foundation. All rights reserved.