inescID.crypto
Class KeyStoreTool
java.lang.Object
inescID.crypto.KeyStoreTool
- public class KeyStoreTool
- extends java.lang.Object
Title: revs
Description: Auxiliar na interaccao com um KeyStore
Copyright: Copyright (c) 2002
Company Inesc-ID
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_KEY_SIZE
public static final int DEFAULT_KEY_SIZE
- See Also:
- Constant Field Values
RSA_ALGORITHM
public static final java.lang.String RSA_ALGORITHM
- See Also:
- Constant Field Values
ks
java.security.KeyStore ks
RSAKeyPairGenerator
java.security.KeyPairGenerator RSAKeyPairGenerator
RSAKeyFactory
java.security.KeyFactory RSAKeyFactory
KeyStoreTool
public KeyStoreTool()
throws java.security.NoSuchAlgorithmException
KeyStoreTool
public KeyStoreTool(java.lang.String keyStorePath,
char[] passwd)
throws java.io.FileNotFoundException,
java.security.KeyStoreException,
java.security.cert.CertificateException,
java.security.NoSuchAlgorithmException,
java.io.IOException
init
protected void init()
throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
genRSAKeyPair
public java.security.KeyPair genRSAKeyPair()
genRSAKeyPair
public java.security.KeyPair genRSAKeyPair(int size)
getPublicKey
public java.security.PublicKey getPublicKey(java.lang.String alias)
throws java.security.UnrecoverableKeyException,
java.security.NoSuchAlgorithmException,
java.security.KeyStoreException
- Throws:
java.security.UnrecoverableKeyException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.String alias,
char[] passwd)
throws java.security.UnrecoverableKeyException,
java.security.NoSuchAlgorithmException,
java.security.KeyStoreException
- Throws:
java.security.UnrecoverableKeyException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
getRSAPrivateKey
public java.security.interfaces.RSAPrivateKey getRSAPrivateKey(byte[] chave)
throws java.security.spec.InvalidKeySpecException
- Throws:
java.security.spec.InvalidKeySpecException
getRSAPublicKey
public java.security.interfaces.RSAPublicKey getRSAPublicKey(byte[] chave)
throws java.security.spec.InvalidKeySpecException
- Throws:
java.security.spec.InvalidKeySpecException
getPublicKeyFromCertFile
public java.security.PublicKey getPublicKeyFromCertFile(java.lang.String file)