public class CryptoUtilities
Modifier and Type | Method and Description |
---|---|
static java.util.Set<java.security.PublicKey> |
byKeys(java.lang.Iterable<? extends net.corda.core.crypto.DigitalSignature.WithKey> $receiver)
Returns the set of all PublicKeys of the signatures
|
static java.security.PrivateKey |
component1(java.security.KeyPair $receiver) |
static java.security.PublicKey |
component2(java.security.KeyPair $receiver) |
static java.security.KeyPair |
entropyToKeyPair(java.math.BigInteger entropy)
Returns a key pair derived from the given private key entropy. This is useful for unit tests and other cases where
you want hard-coded private keys.
|
static java.security.KeyPair |
generateKeyPair()
A simple wrapper that will make it easier to swap out the EC algorithm we use in future
|
static CompositeKey |
getComposite(java.security.PublicKey $receiver)
Creates a
class CompositeKey with a single leaf node containing the public key |
static net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec |
getEd25519Curve() |
static CompositeKey |
getNullCompositeKey() |
static java.security.SecureRandom |
newSecureRandom() |
static net.i2p.crypto.eddsa.EdDSAPublicKey |
parsePublicKeyBase58(java.lang.String base58String) |
static DigitalSignature |
signWithECDSA(java.security.PrivateKey $receiver,
byte[] bytes)
Utility to simplify the act of signing a byte array
|
static DigitalSignature.WithKey |
signWithECDSA(java.security.PrivateKey $receiver,
byte[] bytesToSign,
java.security.PublicKey publicKey) |
static DigitalSignature.WithKey |
signWithECDSA(java.security.KeyPair $receiver,
byte[] bytesToSign) |
static DigitalSignature.WithKey |
signWithECDSA(java.security.KeyPair $receiver,
OpaqueBytes bytesToSign) |
static DigitalSignature.LegallyIdentifiable |
signWithECDSA(java.security.KeyPair $receiver,
OpaqueBytes bytesToSign,
Party party) |
static DigitalSignature.LegallyIdentifiable |
signWithECDSA(java.security.KeyPair $receiver,
byte[] bytesToSign,
Party party) |
static java.lang.String |
toBase58String(java.security.PublicKey $receiver) |
static java.lang.String |
toStringShort(java.security.PublicKey $receiver)
Render a public key to a string, using a short form if it's an elliptic curve public key
|
static void |
verifyWithECDSA(java.security.PublicKey $receiver,
byte[] content,
DigitalSignature signature)
Utility to simplify the act of verifying a signature
|
public static java.security.SecureRandom newSecureRandom()
public static CompositeKey getNullCompositeKey()
public static DigitalSignature signWithECDSA(java.security.PrivateKey $receiver, byte[] bytes)
Utility to simplify the act of signing a byte array
public static DigitalSignature.WithKey signWithECDSA(java.security.PrivateKey $receiver, byte[] bytesToSign, java.security.PublicKey publicKey)
public static net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec getEd25519Curve()
public static net.i2p.crypto.eddsa.EdDSAPublicKey parsePublicKeyBase58(java.lang.String base58String)
public static java.lang.String toBase58String(java.security.PublicKey $receiver)
public static DigitalSignature.WithKey signWithECDSA(java.security.KeyPair $receiver, byte[] bytesToSign)
public static DigitalSignature.WithKey signWithECDSA(java.security.KeyPair $receiver, OpaqueBytes bytesToSign)
public static DigitalSignature.LegallyIdentifiable signWithECDSA(java.security.KeyPair $receiver, OpaqueBytes bytesToSign, Party party)
public static DigitalSignature.LegallyIdentifiable signWithECDSA(java.security.KeyPair $receiver, byte[] bytesToSign, Party party)
public static void verifyWithECDSA(java.security.PublicKey $receiver, byte[] content, DigitalSignature signature)
Utility to simplify the act of verifying a signature
public static java.lang.String toStringShort(java.security.PublicKey $receiver)
Render a public key to a string, using a short form if it's an elliptic curve public key
public static CompositeKey getComposite(java.security.PublicKey $receiver)
Creates a class CompositeKey
with a single leaf node containing the public key
class CompositeKey
public static java.util.Set<java.security.PublicKey> byKeys(java.lang.Iterable<? extends net.corda.core.crypto.DigitalSignature.WithKey> $receiver)
Returns the set of all PublicKeys of the signatures
public static java.security.PrivateKey component1(java.security.KeyPair $receiver)
public static java.security.PublicKey component2(java.security.KeyPair $receiver)
public static java.security.KeyPair generateKeyPair()
A simple wrapper that will make it easier to swap out the EC algorithm we use in future
public static java.security.KeyPair entropyToKeyPair(java.math.BigInteger entropy)
Returns a key pair derived from the given private key entropy. This is useful for unit tests and other cases where you want hard-coded private keys.