com.jp.protection.security
Class BouncyCastleSecurityProvider
java.lang.Object
com.jp.protection.security.BouncyCastleSecurityProvider
- All Implemented Interfaces:
- SecurityProvider
public class BouncyCastleSecurityProvider
- extends java.lang.Object
- implements SecurityProvider
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fKeySize
protected int fKeySize
fCipher
protected javax.crypto.Cipher fCipher
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
fName
protected java.lang.String fName
fID
protected java.lang.String fID
SUPPORTED_KEY_LENGTHS
public static final int[] SUPPORTED_KEY_LENGTHS
BouncyCastleSecurityProvider
public BouncyCastleSecurityProvider(int aKeySize)
BouncyCastleSecurityProvider
public BouncyCastleSecurityProvider()
doFinal
static byte[] doFinal(javax.crypto.Cipher aCipher,
byte[] aData)
throws javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.lang.IllegalStateException,
java.io.IOException
- Throws:
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
java.lang.IllegalStateException
java.io.IOException
checkKeySize
protected void checkKeySize(int aKeySize)
decode
public byte[] decode(byte[] aData,
java.security.PublicKey aPublicKey)
- Specified by:
decode in interface SecurityProvider
encode
public byte[] encode(byte[] aData,
java.security.PrivateKey aPrivateKey)
- Specified by:
encode in interface SecurityProvider
getCipher
protected javax.crypto.Cipher getCipher()
throws javax.crypto.NoSuchPaddingException,
java.security.NoSuchProviderException,
java.security.NoSuchAlgorithmException
- Throws:
javax.crypto.NoSuchPaddingException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
generateKeyPair
public java.security.KeyPair generateKeyPair()
- Specified by:
generateKeyPair in interface SecurityProvider
getID
public java.lang.String getID()
- Specified by:
getID in interface SecurityProvider
getName
public java.lang.String getName()
- Specified by:
getName in interface SecurityProvider
readKey
protected static java.security.Key readKey(byte[] aKeyData)
getKeyData
protected static byte[] getKeyData(java.security.Key aKey)
getPrivateKey
public java.security.PrivateKey getPrivateKey(byte[] aKeyData)
- Specified by:
getPrivateKey in interface SecurityProvider
getPrivateKeyData
public byte[] getPrivateKeyData(java.security.PrivateKey aPrivateKey)
- Specified by:
getPrivateKeyData in interface SecurityProvider
getPublicKey
public java.security.PublicKey getPublicKey(byte[] aKeyData)
- Specified by:
getPublicKey in interface SecurityProvider
getPublicKeyData
public byte[] getPublicKeyData(java.security.PublicKey aPublicKey)
- Specified by:
getPublicKeyData in interface SecurityProvider
getSupportedKeyLengths
public int[] getSupportedKeyLengths()
- Specified by:
getSupportedKeyLengths in interface SecurityProvider
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object