|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.schmizz.sshj.common.SecurityUtils
public class SecurityUtils
Static utility method relating to security facilities.
Field Summary | |
---|---|
static String |
BOUNCY_CASTLE
Identifier for the BouncyCastle JCE provider |
Constructor Summary | |
---|---|
SecurityUtils()
|
Method Summary | |
---|---|
static Cipher |
getCipher(String transformation)
|
static String |
getFingerprint(PublicKey key)
Computes the fingerprint for a public key, in the standard SSH format, e.g. |
static KeyAgreement |
getKeyAgreement(String algorithm)
Creates a new instance of KeyAgreement with the given algorithm. |
static KeyFactory |
getKeyFactory(String algorithm)
Creates a new instance of KeyFactory with the given algorithm. |
static KeyPairGenerator |
getKeyPairGenerator(String algorithm)
Creates a new instance of KeyPairGenerator with the given algorithm. |
static Mac |
getMAC(String algorithm)
Create a new instance of Mac with the given algorithm. |
static MessageDigest |
getMessageDigest(String algorithm)
Create a new instance of MessageDigest with the given algorithm. |
static String |
getSecurityProvider()
Get the identifier for the registered security provider. |
static Signature |
getSignature(String algorithm)
|
static boolean |
isBouncyCastleRegistered()
Attempts registering BouncyCastle as security provider if it has not been previously attempted and returns whether the registration succeeded. |
static void |
setRegisterBouncyCastle(boolean registerBouncyCastle)
|
static void |
setSecurityProvider(String securityProvider)
Specifies the JCE security provider that should be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BOUNCY_CASTLE
Constructor Detail |
---|
public SecurityUtils()
Method Detail |
---|
public static Cipher getCipher(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException
NoSuchAlgorithmException
NoSuchPaddingException
NoSuchProviderException
public static String getFingerprint(PublicKey key)
key
- the public key
public static KeyAgreement getKeyAgreement(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
KeyAgreement
with the given algorithm.
algorithm
- key agreement algorithm
NoSuchAlgorithmException
NoSuchProviderException
public static KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
KeyFactory
with the given algorithm.
algorithm
- key factory algorithm e.g. RSA, DSA
NoSuchAlgorithmException
NoSuchProviderException
public static KeyPairGenerator getKeyPairGenerator(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
KeyPairGenerator
with the given algorithm.
algorithm
- key pair generator algorithm
NoSuchAlgorithmException
NoSuchProviderException
public static Mac getMAC(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
Mac
with the given algorithm.
algorithm
- MAC algorithm
NoSuchAlgorithmException
NoSuchProviderException
public static MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
MessageDigest
with the given algorithm.
algorithm
- MessageDigest algorithm name
NoSuchAlgorithmException
NoSuchProviderException
public static String getSecurityProvider()
public static Signature getSignature(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
NoSuchAlgorithmException
NoSuchProviderException
public static boolean isBouncyCastleRegistered()
public static void setRegisterBouncyCastle(boolean registerBouncyCastle)
public static void setSecurityProvider(String securityProvider)
securityProvider
- identifier for the security provider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |