Constructor Summary |
KeyStoreHelper()
Creates a KeyStoreHelper and initialises the KeyStore, by loading its entries. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_SIGN
public static final String PROP_SIGN
- See Also:
- Constant Field Values
PROP_PVT_KS_URL
public static final String PROP_PVT_KS_URL
- See Also:
- Constant Field Values
PROP_PVT_KS_PWD
public static final String PROP_PVT_KS_PWD
- See Also:
- Constant Field Values
PROP_PVT_ALIAS
public static final String PROP_PVT_ALIAS
- See Also:
- Constant Field Values
PROP_PVT_PWD
public static final String PROP_PVT_PWD
- See Also:
- Constant Field Values
PROP_PUB_KS_URL
public static final String PROP_PUB_KS_URL
- See Also:
- Constant Field Values
PROP_PUB_KS_PWD
public static final String PROP_PUB_KS_PWD
- See Also:
- Constant Field Values
KeyStoreHelper
public KeyStoreHelper()
- Creates a KeyStoreHelper and initialises the KeyStore, by loading its entries.
- Throws:
RuntimeDroolsException
- in case any error happens when initialising and loading the keystore.
signDataWithPrivateKey
public byte[] signDataWithPrivateKey(byte[] data)
throws UnrecoverableKeyException,
KeyStoreException,
NoSuchAlgorithmException,
InvalidKeyException,
SignatureException
- Generates the signature for the given byte[] using MD5 with RSA algorithm and the
private key with which this helper was initialised.
- Parameters:
data
- the byte[] of data to be signed
- Returns:
- the signature, encrypted with the private key
- Throws:
UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
InvalidKeyException
SignatureException
checkDataWithPublicKey
public boolean checkDataWithPublicKey(String publicKeyAlias,
byte[] data,
byte[] signature)
throws KeyStoreException,
NoSuchAlgorithmException,
InvalidKeyException,
SignatureException
- Checks the given byte[] data against the signature, using the
public key with which this helper was initialised and the algorithm
MD5 with RSA.
- Parameters:
data
- the original data that was signedsignature
- the provided signature
- Returns:
- true in case the signature matches, false otherwise.
- Throws:
KeyStoreException
NoSuchAlgorithmException
InvalidKeyException
SignatureException
isSigned
public boolean isSigned()
getPvtKeyStoreURL
public URL getPvtKeyStoreURL()
getPvtKeyStorePwd
public char[] getPvtKeyStorePwd()
getPvtKeyAlias
public String getPvtKeyAlias()
getPvtKeyPassword
public char[] getPvtKeyPassword()
getPubKeyStoreURL
public URL getPubKeyStoreURL()
getPubKeyStorePwd
public char[] getPubKeyStorePwd()
getPvtKeyStore
public KeyStore getPvtKeyStore()
getPubKeyStore
public KeyStore getPubKeyStore()
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.