Interface SecurityModule
-
public interface SecurityModule
Provides a generic interface for classes which wrap/hide a cryptographic private key. This interface ensures cryptographic functions required by Ethereum are available to the application at large, without releasing the content of the private key.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.tuweni.bytes.Bytes32
calculateECDHKeyAgreement(PublicKey partyKey)
Perform ECDH key agreement calculations.PublicKey
getPublicKey()
The public key associated with this security module.Signature
sign(org.apache.tuweni.bytes.Bytes32 dataHash)
Produces a signature for the given hash.
-
-
-
Method Detail
-
sign
Signature sign(org.apache.tuweni.bytes.Bytes32 dataHash) throws SecurityModuleException
Produces a signature for the given hash.- Parameters:
dataHash
- The Keccack hash of a set of data, which is to be signed.- Returns:
- the signature (R, S) generated by signing the hash with the node key
- Throws:
SecurityModuleException
- if sign fails
-
getPublicKey
PublicKey getPublicKey() throws SecurityModuleException
The public key associated with this security module.- Returns:
- the public key associated with the key stored behind this interface.
- Throws:
SecurityModuleException
- if getPublicKey fails
-
calculateECDHKeyAgreement
org.apache.tuweni.bytes.Bytes32 calculateECDHKeyAgreement(PublicKey partyKey) throws SecurityModuleException
Perform ECDH key agreement calculations.- Parameters:
partyKey
- the key with which an agreement is to be created.- Returns:
- The bytes forming the agreement
- Throws:
SecurityModuleException
- if calculateECDHKeyAgreement fails
-
-