|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ComponentRole public interface X509CryptoService
Service allowing components to sign text, determine the validity and signer of already signed text, create keys, and register new certificates.
| Method Summary | |
|---|---|
XWikiX509Certificate |
certFromPEM(java.lang.String pemFormatCert)
Deserialize an X509 certificate from a PEM formatted string. |
XWikiX509Certificate[] |
certsFromSpkac(java.lang.String spkacSerialization,
int daysOfValidity)
Creates an array of Base64 encoded DER formatted X509Certificates containing: 1. |
XWikiX509KeyPair |
keyPairFromBase64(java.lang.String keyPairAsBase64)
Deserialize an XWikiX509KeyPair from a base64 encoded String. |
XWikiX509KeyPair |
newCertAndPrivateKey(int daysOfValidity,
java.lang.String password)
Creates an XWikiX509Certificate and matching private key. |
java.lang.String |
signText(java.lang.String textToSign,
XWikiX509KeyPair toSignWith,
java.lang.String password)
Produce a pkcs#7 signature for the given text. |
XWikiX509Certificate |
verifyText(java.lang.String signedText,
java.lang.String base64Signature)
Verify a pkcs#7 signature and return the certificate of the user who signed it. |
| Method Detail |
|---|
XWikiX509Certificate[] certsFromSpkac(java.lang.String spkacSerialization,
int daysOfValidity)
throws java.security.GeneralSecurityException
spkacSerialization - a SPKAC Certificate Signing RequestdaysOfValidity - number of days before the certificate should become invalid.
java.security.GeneralSecurityException - if something goes wrong while creating the certificate.
XWikiX509KeyPair newCertAndPrivateKey(int daysOfValidity,
java.lang.String password)
throws java.security.GeneralSecurityException
daysOfValidity - number of days before the certificate should become invalid.password - the password to set on the resulting XWikiX509KeyPair.
java.security.GeneralSecurityException - if something goes wrong while creating the certificate.
java.lang.String signText(java.lang.String textToSign,
XWikiX509KeyPair toSignWith,
java.lang.String password)
throws java.security.GeneralSecurityException
textToSign - the text which the user wishes to sign.toSignWith - the certificate and matching private key to sign the text with.password - to access the private key in the key pair.
java.security.GeneralSecurityException - if anything goes wrong during signing.
XWikiX509Certificate verifyText(java.lang.String signedText,
java.lang.String base64Signature)
throws java.security.GeneralSecurityException
signedText - the text which has been signed.base64Signature - the signature on the text in Base64 encoded DER format.
java.security.GeneralSecurityException - if anything goes wrong.
XWikiX509Certificate certFromPEM(java.lang.String pemFormatCert)
throws java.security.GeneralSecurityException
pemFormatCert - a String created by XWikiX509Certificate.toPEMString()
or from OpenSSL or any other standards compliant X509 certificate generator in PEM format.
XWikiX509Certificate which extends
X509Certificate and can be used by methods in this class as well as with
third party encryption tools.
java.security.GeneralSecurityException - If there isn't a valid XWikiX509Certificate.CERT_BEGIN or
XWikiX509Certificate.CERT_END tag, or if there is an exception parsing
the content inbetween.
XWikiX509KeyPair keyPairFromBase64(java.lang.String keyPairAsBase64)
throws java.security.GeneralSecurityException
XWikiX509KeyPair from a base64 encoded String.
keyPairAsBase64 - a String created by calling
XWikiX509KeyPair.serializeAsBase64()
XWikiX509KeyPair
java.security.GeneralSecurityException - if the data has become corrupted or
if something fails during the deserialization process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||