public class SecurityUtils extends Object
| Constructor and Description |
|---|
SecurityUtils() |
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
decodePrivateKeyFromBase64(String enc)
Decodes a private key from an encoded value.
|
static PrivateKey |
decodePrivateKeyFromBase64(String enc,
String algo)
Decodes a private key from an encoded value.
|
static PrivateKey |
decodePrivateKeyFromHex(String enc)
Decodes a private key from an encoded value.
|
static PrivateKey |
decodePrivateKeyFromHex(String enc,
String algo)
Decodes a private key from an encoded value.
|
static PublicKey |
decodePublicKeyFromBase64(String enc)
Decodes a public key from an encoded value.
|
static PublicKey |
decodePublicKeyFromBase64(String enc,
String algo)
Decodes a public key from an encoded value.
|
static PublicKey |
decodePublicKeyFromHex(String enc)
Decodes a public key from an encoded value.
|
static PublicKey |
decodePublicKeyFromHex(String enc,
String algo)
Decodes a public key from an encoded value.
|
static String |
encodeToBase64(PrivateKey privk) |
static String |
encodeToBase64(PublicKey pubk) |
static String |
encodeToHex(PrivateKey privk) |
static String |
encodeToHex(PublicKey pubk) |
static String |
getMD5Hash(String in,
String encoding) |
static byte[] |
md5Hash(byte[] data)
Returns the MD5 hash for the data passed.
|
public static String encodeToHex(PrivateKey privk)
public static String encodeToBase64(PrivateKey privk)
public static PublicKey decodePublicKeyFromHex(String enc, String algo) throws Exception
enc - the hex string.Exceptionpublic static PrivateKey decodePrivateKeyFromHex(String enc, String algo) throws Exception
enc - the hex string.Exceptionpublic static PublicKey decodePublicKeyFromHex(String enc) throws Exception
enc - the hex string.Exceptionpublic static PrivateKey decodePrivateKeyFromHex(String enc) throws Exception
enc - the hex string.Exceptionpublic static PublicKey decodePublicKeyFromBase64(String enc) throws Exception
enc - the hex string.Exceptionpublic static PrivateKey decodePrivateKeyFromBase64(String enc) throws Exception
enc - the hex string.Exceptionpublic static PublicKey decodePublicKeyFromBase64(String enc, String algo) throws Exception
enc - the hex string.Exceptionpublic static PrivateKey decodePrivateKeyFromBase64(String enc, String algo) throws Exception
enc - the hex string.Exceptionpublic static byte[] md5Hash(byte[] data)
Copyright © 2017 etc.to. All rights reserved.