public class KeyPairIdentity extends java.lang.Object implements PublicKeyIdentity
KeyPair
to generate the identity signatureModifier and Type | Field and Description |
---|---|
private java.security.KeyPair |
pair |
private java.util.Collection<NamedFactory<Signature>> |
signatureFactories |
Constructor and Description |
---|
KeyPairIdentity(SignatureFactoriesManager primary,
SignatureFactoriesManager secondary,
java.security.KeyPair pair) |
Modifier and Type | Method and Description |
---|---|
java.security.PublicKey |
getPublicKey() |
byte[] |
sign(SessionContext session,
byte[] data)
Proves the public key identity by signing the given data
|
java.lang.String |
toString() |
private final java.security.KeyPair pair
private final java.util.Collection<NamedFactory<Signature>> signatureFactories
public KeyPairIdentity(SignatureFactoriesManager primary, SignatureFactoriesManager secondary, java.security.KeyPair pair)
public java.security.PublicKey getPublicKey()
getPublicKey
in interface PublicKeyIdentity
PublicKey
identity valuepublic byte[] sign(SessionContext session, byte[] data) throws java.lang.Exception
PublicKeyIdentity
sign
in interface PublicKeyIdentity
session
- The SessionContext
for calling this method - may be null
if not called within a
session contextdata
- Data to signjava.lang.Exception
- If failed to sign the datapublic java.lang.String toString()
toString
in class java.lang.Object