Class Util
java.lang.Object
net.finmath.smartcontracts.representablestate.xml.util.Util
Utilities related to encryption/decryption/hashing
- Author:
- Christian Fries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Generate a random secrete (base64 encoded).static StringgetBase64(byte[] bytes) getBase64.static StringgetHex(byte[] bytes) getHex.static StringgetHexTrimmed(byte[] bytes) getHexTrimmed.static StringgetHexTrimmed(byte[] bytes, int len) getHexTrimmed.static PrivateKeyprivateKeyFromPath(Path path) privateKeyFromPath.static PublicKeypublicKeyFromPath(Path path) publicKeyFromPath.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
getHex
getHex.
- Parameters:
bytes- an array of byte- Returns:
- a
Stringobject representing the byte array in hex.
-
getHexTrimmed
getHexTrimmed.
- Parameters:
bytes- an array of byte- Returns:
- a
Stringobject representing the byte array in base64.
-
getHexTrimmed
getHexTrimmed.
- Parameters:
bytes- an array of bytelen- the length to represent- Returns:
- a
Stringobject with starting hex encodings of the byte array.
-
getBase64
getBase64.
- Parameters:
bytes- an array of byte- Returns:
- a
Stringobject
-
generateRandomSecret
public static byte[] generateRandomSecret()Generate a random secrete (base64 encoded).- Returns:
- A string representing a random secret.
-
publicKeyFromPath
publicKeyFromPath.
-
privateKeyFromPath
privateKeyFromPath.
- Parameters:
path- aPathobject- Returns:
- a
PrivateKeyobject
-