Class KeyPairIdentity

  • All Implemented Interfaces:
    PublicKeyIdentity

    public class KeyPairIdentity
    extends java.lang.Object
    implements PublicKeyIdentity
    Uses a KeyPair to generate the identity signature
    • Field Detail

      • pair

        private final java.security.KeyPair pair
    • Method Detail

      • getPublicKey

        public java.security.PublicKey getPublicKey()
        Specified by:
        getPublicKey in interface PublicKeyIdentity
        Returns:
        The PublicKey identity value
      • sign

        public byte[] sign​(SessionContext session,
                           byte[] data)
                    throws java.lang.Exception
        Description copied from interface: PublicKeyIdentity
        Proves the public key identity by signing the given data
        Specified by:
        sign in interface PublicKeyIdentity
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        data - Data to sign
        Returns:
        Signed data - using the identity
        Throws:
        java.lang.Exception - If failed to sign the data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object