public abstract class SecretKeyPair
extends java.lang.Object
InMemorySecretKeyStore
.Constructor and Description |
---|
SecretKeyPair() |
Modifier and Type | Method and Description |
---|---|
static SecretKeyPair |
create(boolean isActive,
CryptoType cryptoType)
Creates a new secret key pair.
|
static SecretKeyPair |
create(boolean isActive,
CryptoType cryptoType,
java.security.KeyPair key)
Creates a new secret key pair.
|
static SecretKeyPair |
create(CryptoType cryptoType)
Creates a new secret key pair.
|
abstract CryptoType |
cryptoType()
Crypto type, the algorithm used for signing and verification.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
id()
Returns key id.
|
abstract boolean |
isActive()
Returns true if this key is the active key.
|
abstract java.security.KeyPair |
key()
Returns key pair.
|
java.security.PrivateKey |
privateKey()
Returns private key.
|
java.lang.String |
privateKeyString()
Returns private key in a string format (encoded).
|
java.security.PublicKey |
publicKey()
Returns public key.
|
java.lang.String |
publicKeyString()
Returns public key in a string format (encoded).
|
java.lang.String |
toString() |
TrustedKey |
toTrustedKey()
Converts secret key to the
TrustedKey . |
public static SecretKeyPair create(CryptoType cryptoType)
cryptoType
- crypto to usepublic static SecretKeyPair create(boolean isActive, CryptoType cryptoType)
isActive
- true if this is the active keycryptoType
- crypto to usepublic static SecretKeyPair create(boolean isActive, CryptoType cryptoType, java.security.KeyPair key)
isActive
- true if this is the active keycryptoType
- crypto to usekey
- key pair to usepublic java.lang.String id()
public TrustedKey toTrustedKey()
TrustedKey
.public java.security.PublicKey publicKey()
public java.lang.String publicKeyString()
public java.security.PrivateKey privateKey()
public java.lang.String privateKeyString()
public abstract boolean isActive()
public abstract CryptoType cryptoType()
public abstract java.security.KeyPair key()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object