|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.crypto.x509.internal.X509Keymaker
public class X509Keymaker
Keymaker allows you to create keypairs and X509Certificates.
| Constructor Summary | |
|---|---|
X509Keymaker()
|
|
| Method Summary | |
|---|---|
java.security.cert.X509Certificate |
getAuthorityCertificate()
|
java.security.cert.X509Certificate |
makeCertificateAuthority(java.security.KeyPair keyPair,
int daysOfValidity,
java.lang.String commonName)
Create a new self signed X509 certificate authority certificate. |
java.security.cert.X509Certificate[] |
makeClientAndAuthorityCertificates(java.security.PublicKey forCert,
int daysOfValidity,
boolean nonRepudiable,
java.lang.String webId,
java.lang.String userName)
Create a new X509 client certificate and a certificate authority certificate. |
java.security.cert.X509Certificate |
makeClientCertificate(java.security.PublicKey forCert,
java.security.KeyPair toSignWith,
int daysOfValidity,
boolean nonRepudiable,
java.lang.String webId,
java.lang.String userName)
Create a new X509 client certificate. |
java.security.KeyPair |
newKeyPair()
|
void |
setAuthorityCertificate(java.security.cert.X509Certificate authorityCertificate)
If called then all future client certificates will be packaged with this certificate authority. |
void |
setAuthorityKeyPair(java.security.KeyPair authorityKeyPair)
If called then all future client certificates will be signed with this KeyPair. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public X509Keymaker()
| Method Detail |
|---|
public java.security.KeyPair newKeyPair()
public void setAuthorityKeyPair(java.security.KeyPair authorityKeyPair)
authorityKeyPair - the KeyPair to sign all client keys with.public void setAuthorityCertificate(java.security.cert.X509Certificate authorityCertificate)
authorityCertificate - the certificate authority to provide with client certificates.public java.security.cert.X509Certificate getAuthorityCertificate()
public java.security.cert.X509Certificate[] makeClientAndAuthorityCertificates(java.security.PublicKey forCert,
int daysOfValidity,
boolean nonRepudiable,
java.lang.String webId,
java.lang.String userName)
throws java.security.GeneralSecurityException
forCert - the public key which will be embedded in the certificate, whoever has the matching private key
"owns" the certificate.daysOfValidity - number of days the cert should be valid for.nonRepudiable - this should only be true if the private key is not stored on the server.webId - the URI to put as the alternative name (for FOAFSSL webId compatibility)userName - a String representation of the name of the user getting the certificate.
java.security.GeneralSecurityException - if something goes wrong.
public java.security.cert.X509Certificate makeClientCertificate(java.security.PublicKey forCert,
java.security.KeyPair toSignWith,
int daysOfValidity,
boolean nonRepudiable,
java.lang.String webId,
java.lang.String userName)
throws java.security.GeneralSecurityException
forCert - the public key which will be embedded in the certificate, whoever has the matching private key
"owns" the certificate.toSignWith - the private key in this pair will be used to sign the certificate.daysOfValidity - number of days the cert should be valid for.nonRepudiable - this should only be true if the private key is not stored on the server.webId - the URI to put as the alternative name (for FOAFSSL webId compatibility)userName - a String representation of the name of the user getting the certificate.
java.security.GeneralSecurityException - if something goes wrong.
public java.security.cert.X509Certificate makeCertificateAuthority(java.security.KeyPair keyPair,
int daysOfValidity,
java.lang.String commonName)
throws java.security.GeneralSecurityException
keyPair - the public key will appear in the certificate and the private key will be used to sign it.daysOfValidity - number of days the cert should be valid for.commonName - what to put in the common name field, this field will identify this certificate authority
in the list on the user's browser.
java.security.GeneralSecurityException - if something goes wrong.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||