Package com.appslandia.common.crypto
Class KeyFactoryUtil
- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.crypto.KeyFactoryUtil
-
- All Implemented Interfaces:
InitializeSupport
public class KeyFactoryUtil extends InitializeObject
- Author:
- Loc Ha
-
-
Field Summary
Fields Modifier and Type Field Description static KeyFactoryUtilDSAstatic KeyFactoryUtilRSA
-
Constructor Summary
Constructors Constructor Description KeyFactoryUtil()KeyFactoryUtil(java.lang.String algorithm)KeyFactoryUtil(java.lang.String algorithm, java.lang.String provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.PrivateKeycopy(java.security.PrivateKey key)java.security.PublicKeycopy(java.security.PublicKey key)protected voidinit()KeyFactoryUtilsetAlgorithm(java.lang.String algorithm)KeyFactoryUtilsetProvider(java.lang.String provider)java.security.PrivateKeytoPrivateKey(java.io.InputStream keyInDer)java.security.PrivateKeytoPrivateKey(java.lang.String keyInPem)java.security.PublicKeytoPublicKey(java.io.InputStream keyInDer)java.security.PublicKeytoPublicKey(java.lang.String keyInPem)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, destroy, initialize
-
-
-
-
Field Detail
-
DSA
public static final KeyFactoryUtil DSA
-
RSA
public static final KeyFactoryUtil RSA
-
-
Method Detail
-
init
protected void init() throws java.lang.Exception- Specified by:
initin classInitializeObject- Throws:
java.lang.Exception
-
toPrivateKey
public java.security.PrivateKey toPrivateKey(java.lang.String keyInPem) throws CryptoException- Throws:
CryptoException
-
toPrivateKey
public java.security.PrivateKey toPrivateKey(java.io.InputStream keyInDer) throws java.io.IOException, CryptoException- Throws:
java.io.IOExceptionCryptoException
-
toPublicKey
public java.security.PublicKey toPublicKey(java.lang.String keyInPem) throws CryptoException- Throws:
CryptoException
-
toPublicKey
public java.security.PublicKey toPublicKey(java.io.InputStream keyInDer) throws java.io.IOException, CryptoException- Throws:
java.io.IOExceptionCryptoException
-
copy
public java.security.PrivateKey copy(java.security.PrivateKey key) throws CryptoException- Throws:
CryptoException
-
copy
public java.security.PublicKey copy(java.security.PublicKey key) throws CryptoException- Throws:
CryptoException
-
setAlgorithm
public KeyFactoryUtil setAlgorithm(java.lang.String algorithm)
-
setProvider
public KeyFactoryUtil setProvider(java.lang.String provider)
-
-