| java.lang.Object |
| ↳ |
net.schmizz.sshj.common.SecurityUtils |
Class Overview
Static utility method relating to security facilities.
Summary
| Constants |
| String |
BOUNCY_CASTLE |
Identifier for the BouncyCastle JCE provider |
| Public Methods |
|
synchronized
static
Cipher
|
getCipher(String transformation)
|
|
static
String
|
getFingerprint(PublicKey key)
Computes the fingerprint for a public key, in the standard SSH format, e.g.
|
|
synchronized
static
KeyAgreement
|
getKeyAgreement(String algorithm)
Creates a new instance of KeyAgreement with the given algorithm.
|
|
synchronized
static
KeyFactory
|
getKeyFactory(String algorithm)
Creates a new instance of KeyFactory with the given algorithm.
|
|
synchronized
static
KeyPairGenerator
|
getKeyPairGenerator(String algorithm)
Creates a new instance of KeyPairGenerator with the given algorithm.
|
|
synchronized
static
Mac
|
getMAC(String algorithm)
Create a new instance of Mac with the given algorithm.
|
|
synchronized
static
MessageDigest
|
getMessageDigest(String algorithm)
Create a new instance of MessageDigest with the given algorithm.
|
|
synchronized
static
String
|
getSecurityProvider()
Get the identifier for the registered security provider.
|
|
synchronized
static
Signature
|
getSignature(String algorithm)
|
|
synchronized
static
boolean
|
isBouncyCastleRegistered()
Attempts registering BouncyCastle as security provider if it has not been previously attempted and returns
whether the registration succeeded.
|
|
synchronized
static
void
|
setRegisterBouncyCastle(boolean registerBouncyCastle)
|
|
synchronized
static
void
|
setSecurityProvider(String securityProvider)
Specifies the JCE security provider that should be used.
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
public
static
final
String
BOUNCY_CASTLE
Identifier for the BouncyCastle JCE provider
Constant Value:
"BC"
Fields
private
static
final
Logger
LOG
private
static
Boolean
registerBouncyCastle
private
static
boolean
registrationDone
private
static
String
securityProvider
Public Constructors
Public Methods
public
static
synchronized
Cipher
getCipher
(String transformation)
Throws
| NoSuchAlgorithmException
| |
| NoSuchPaddingException
| |
| NoSuchProviderException
| |
public
static
String
getFingerprint
(PublicKey key)
Computes the fingerprint for a public key, in the standard SSH format, e.g. "4b:69:6c:72:6f:79:20:77:61:73:20:68:65:72:65:21"
public
static
synchronized
KeyAgreement
getKeyAgreement
(String algorithm)
Creates a new instance of KeyAgreement with the given algorithm.
Parameters
| algorithm
| Key agreement algorithm |
Throws
| NoSuchProviderException
| |
| NoSuchAlgorithmException
| |
public
static
synchronized
KeyFactory
getKeyFactory
(String algorithm)
Creates a new instance of KeyFactory with the given algorithm.
Parameters
| algorithm
| Key factory algorithm e.g. RSA, DSA |
Throws
| NoSuchProviderException
| |
| NoSuchAlgorithmException
| |
public
static
synchronized
KeyPairGenerator
getKeyPairGenerator
(String algorithm)
Creates a new instance of KeyPairGenerator with the given algorithm.
Parameters
| algorithm
| Key pair generator algorithm |
Throws
| NoSuchProviderException
| |
| NoSuchAlgorithmException
| |
public
static
synchronized
Mac
getMAC
(String algorithm)
Create a new instance of Mac with the given algorithm.
Throws
| NoSuchProviderException
| |
| NoSuchAlgorithmException
| |
public
static
synchronized
MessageDigest
getMessageDigest
(String algorithm)
Create a new instance of MessageDigest with the given algorithm.
Parameters
| algorithm
| MessageDigest algorithm name |
Throws
| NoSuchProviderException
| |
| NoSuchAlgorithmException
| |
public
static
synchronized
String
getSecurityProvider
()
Get the identifier for the registered security provider.
public
static
synchronized
Signature
getSignature
(String algorithm)
Throws
| NoSuchAlgorithmException
| |
| NoSuchProviderException
| |
public
static
synchronized
boolean
isBouncyCastleRegistered
()
Attempts registering BouncyCastle as security provider if it has not been previously attempted and returns
whether the registration succeeded.
public
static
synchronized
void
setRegisterBouncyCastle
(boolean registerBouncyCastle)
public
static
synchronized
void
setSecurityProvider
(String securityProvider)
Specifies the JCE security provider that should be used.
Parameters
| securityProvider
| Identifier for the security provider
|