Package org.bouncycastle.openssl.jcajce
Class JcaPKIXIdentityBuilder
- java.lang.Object
-
- org.bouncycastle.openssl.jcajce.JcaPKIXIdentityBuilder
-
public class JcaPKIXIdentityBuilder extends java.lang.ObjectBuilder for a private/public identity object representing a "user". The private key may be in any of the forms understood byJcaPrivateKeyReader(PKCS#1 / PKCS#8, PEM or DER, optionally password-protected viasetPassword(char[])).
-
-
Constructor Summary
Constructors Constructor Description JcaPKIXIdentityBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JcaPKIXIdentitybuild(java.io.File keyFile, java.io.File certificateFile)Build an identity from the passed in key and certificate file in PEM format.JcaPKIXIdentitybuild(java.io.InputStream keyStream, java.io.InputStream certificateStream)Build an identity from the passed in key and certificate stream in PEM format.JcaPKIXIdentityBuildersetPassword(char[] password)Set the password used to decrypt a password-protected private key.JcaPKIXIdentityBuildersetProvider(java.lang.String providerName)JcaPKIXIdentityBuildersetProvider(java.security.Provider provider)
-
-
-
Method Detail
-
setProvider
public JcaPKIXIdentityBuilder setProvider(java.security.Provider provider)
-
setProvider
public JcaPKIXIdentityBuilder setProvider(java.lang.String providerName)
-
setPassword
public JcaPKIXIdentityBuilder setPassword(char[] password)
Set the password used to decrypt a password-protected private key. The password is ignored when the key turns out to be unencrypted, and may be left unset for unencrypted keys.- Parameters:
password- the password to decrypt the private key with.- Returns:
- the current builder instance.
-
build
public JcaPKIXIdentity build(java.io.File keyFile, java.io.File certificateFile) throws java.io.IOException, java.security.cert.CertificateException
Build an identity from the passed in key and certificate file in PEM format.- Parameters:
keyFile- the PEM file containing the keycertificateFile- the PEM file containing the certificate- Returns:
- an identity object.
- Throws:
java.io.IOException- on a general parsing error.java.security.cert.CertificateException- on a certificate parsing error.
-
build
public JcaPKIXIdentity build(java.io.InputStream keyStream, java.io.InputStream certificateStream) throws java.io.IOException, java.security.cert.CertificateException
Build an identity from the passed in key and certificate stream in PEM format.- Parameters:
keyStream- the PEM stream containing the keycertificateStream- the PEM stream containing the certificate- Returns:
- an identity object.
- Throws:
java.io.IOException- on a general parsing error.java.security.cert.CertificateException- on a certificate parsing error.
-
-