| java.lang.Object org.ejbca.core.protocol.xkms.common.XKMSUtil
XKMSUtil | public class XKMSUtil (Code) | | A util class containing static help methods to process various
XKMS messages
author: Philip Vendil 2006 dec 30 version: $Id: XKMSUtil.java,v 1.2 2007/02/02 09:37:48 anatom Exp $ |
Method Summary | |
public static Document | appendKeyBindingAuthentication(Document requestDoc, String passphrase, String prototypeKeyBindingId) | public static Document | appendProofOfPossession(Document requestDoc, PrivateKey privateKey, String prototypeKeyBindingId) | public static PrivateKeyType | getEncryptedXMLFromPrivateKey(RSAPrivateCrtKey rSAPrivateKey, String sharedSecret) Encrypting a java RSA Private key into a PrivateKeyType object used in register,reissue and recover respolses.
using the shared secret.
The method uses the HMAC-SHA1 for generating the shared secret
and tripple des for encryption
Parameters: rSAPrivateKey - the privatekey Parameters: sharedSecret - the shared secret, cannot be null. | public static RSAPrivateKey | getPrivateKeyFromEncryptedXML(PrivateKeyType privateKeyType, String sharedSecret) Method to get the private key from an XKMS message with an encrypted
PrivateKey tag. | public static SecretKey | getSecretKeyFromPassphrase(String passphrase, boolean performSASLprep, int keylength, byte[] keyType) Genereates a secret key from a passphrase according to the
XKMS specifikation. |
KEY_AUTHENTICATION | final public static byte[] KEY_AUTHENTICATION(Code) | | HMAC-SHA1 initial key values
|
KEY_PRIVATEKEYDATA | final public static byte[] KEY_PRIVATEKEYDATA(Code) | | |
KEY_REVOCATIONCODEIDENTIFIER_PASS1 | final public static byte[] KEY_REVOCATIONCODEIDENTIFIER_PASS1(Code) | | |
KEY_REVOCATIONCODEIDENTIFIER_PASS2 | final public static byte[] KEY_REVOCATIONCODEIDENTIFIER_PASS2(Code) | | |
appendKeyBindingAuthentication | public static Document appendKeyBindingAuthentication(Document requestDoc, String passphrase, String prototypeKeyBindingId) throws StringprepException, XMLSecurityException(Code) | | Method appending a authorization keybinding element to
a requestDoc
Parameters: requestDoc - Parameters: passphrase - Parameters: prototypeKeyBindingId - the requestDoc with authorization appended throws: StringprepException - if the passphrase doesn't fullfull the SASLPrep profile throws: XMLSecurityException - If any other exception occured during generation. |
getEncryptedXMLFromPrivateKey | public static PrivateKeyType getEncryptedXMLFromPrivateKey(RSAPrivateCrtKey rSAPrivateKey, String sharedSecret) throws StringprepException, XMLEncryptionException(Code) | | Encrypting a java RSA Private key into a PrivateKeyType object used in register,reissue and recover respolses.
using the shared secret.
The method uses the HMAC-SHA1 for generating the shared secret
and tripple des for encryption
Parameters: rSAPrivateKey - the privatekey Parameters: sharedSecret - the shared secret, cannot be null. The Document with the encrypted key included. throws: StringprepException - if the shared secret doesn't conform with the SASLprep profile as specified in the XKMS specification. throws: XMLEncryptionException - if any other exception occurs during the processing. |
getPrivateKeyFromEncryptedXML | public static RSAPrivateKey getPrivateKeyFromEncryptedXML(PrivateKeyType privateKeyType, String sharedSecret) throws StringprepException, XMLEncryptionException(Code) | | Method to get the private key from an XKMS message with an encrypted
PrivateKey tag. The method uses the HMAC-SHA1 for generating the shared secret
and tripple des for encryption.
Parameters: privateKeyType - the JAXB version of the PrivateKey tag Parameters: sharedSecret - the shared secret, cannot be null. a java RSAPrivateKey throws: StringprepException - if the shared secret doesn't conform with the SASLprep profile as specified in the XKMS specification. throws: XMLEncryptionException - if any other exception occurs during the processing. |
getSecretKeyFromPassphrase | public static SecretKey getSecretKeyFromPassphrase(String passphrase, boolean performSASLprep, int keylength, byte[] keyType) throws StringprepException, XMLEncryptionException(Code) | | Genereates a secret key from a passphrase according to the
XKMS specifikation. The HMAC-SHA1 algorithm is used.
The passphrase is first checked against SALSPrep profile
according to the XKMS specificatiom
Parameters: passphrase - the passphrase to use, may no be null Parameters: performSASLprep - if sASLprep should be called on the input string. Parameters: keylength - the length of the key returned. Parameters: keyType - one of the initial KEY_ constants The SecretKey used in encryption/decryption throws: StringprepException - if the passphrase doesn't fullfull the SASLPrep profile throws: XMLEncryptionException - If any other exception occured during generation. |
|
|