org.xwiki.crypto.x509.internal
Class X509KeyService

java.lang.Object
  extended by org.xwiki.crypto.x509.internal.X509KeyService

public class X509KeyService
extends java.lang.Object

Service allowing a user to create keys and X509 certificates.

Since:
2.5M1
Version:
$Id$

Constructor Summary
X509KeyService()
           
 
Method Summary
 XWikiX509Certificate[] certsFromSpkac(java.lang.String spkacSerialization, int daysOfValidity, java.lang.String webID, java.lang.String userName)
           
 XWikiX509KeyPair newCertAndPrivateKey(int daysOfValidity, java.lang.String webID, java.lang.String userName, java.lang.String password, PasswordCryptoService passwordCryptoService)
          Create a fresh self-signed key pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X509KeyService

public X509KeyService()
Method Detail

certsFromSpkac

public XWikiX509Certificate[] certsFromSpkac(java.lang.String spkacSerialization,
                                             int daysOfValidity,
                                             java.lang.String webID,
                                             java.lang.String userName)
                                      throws java.security.GeneralSecurityException
Parameters:
spkacSerialization - a SPKAC Certificate Signing Request
daysOfValidity - number of days before the certificate should become invalid.
webID - the URL of the user's page. Used for FOAFSSL compatibility.
userName - the String serialization of the user's page name.
Returns:
2 certificates, one a client cert and the other an authority cert which signed the client cert.
Throws:
java.security.GeneralSecurityException - on errors
See Also:
org.xwiki.crypto.CryptoService#certsFromSpkac(String, int)

newCertAndPrivateKey

public XWikiX509KeyPair newCertAndPrivateKey(int daysOfValidity,
                                             java.lang.String webID,
                                             java.lang.String userName,
                                             java.lang.String password,
                                             PasswordCryptoService passwordCryptoService)
                                      throws java.security.GeneralSecurityException
Create a fresh self-signed key pair.

Parameters:
daysOfValidity - number of days before the certificate should become invalid.
webID - the URL of the user's page. Used for FOAFSSL compatibility.
userName - the String serialization of the user's page name.
password - the password to set on the resulting XWikiX509KeyPair.
passwordCryptoService - the service to use for encrypting the private key so this object can safely be serialized without allowing the private key to be read from the database.
Returns:
a certificate and matching private key in an XWikiX509KeyPair object.
Throws:
java.security.GeneralSecurityException - on errors
See Also:
org.xwiki.crypto.CryptoService#newCertAndPrivateKey(int)


Copyright © 2004-2011 XWiki. All Rights Reserved.