public class SignatureUtils extends Object
| Constructor and Description |
|---|
SignatureUtils() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
computeECDSASignature(byte[] bytes,
PrivateKey masterPrivateKey)
Compute ECDSA signature of given bytes with a private key.
|
String |
computePowerAuthSignature(byte[] data,
List<SecretKey> signatureKeys,
long counter)
Compute PowerAuth 2.0 signature for given data using a secret signature
keys and counter.
|
boolean |
validateECDSASignature(byte[] signedBytes,
byte[] signature,
PublicKey masterPublicKey)
Validate an ECDSA signature against given data using a public key.
|
boolean |
validatePowerAuthSignature(byte[] data,
String signature,
List<SecretKey> signatureKeys,
long counter)
Validate the PowerAuth 2.0 signature for given data using provided keys.
|
public byte[] computeECDSASignature(byte[] bytes,
PrivateKey masterPrivateKey)
throws InvalidKeyException,
SignatureException
bytes - Bytes to be signed.masterPrivateKey - Private key for computing the signature.InvalidKeyException - In case invalid key was provided.SignatureException - In case signature calculation fails.public boolean validateECDSASignature(byte[] signedBytes,
byte[] signature,
PublicKey masterPublicKey)
throws InvalidKeyException,
SignatureException
signedBytes - Bytes that are signed.signature - Signature of the bytes.masterPublicKey - Public key for validating the signature.InvalidKeyException - In case invalid key was provided.SignatureException - In case signature calculation fails.public String computePowerAuthSignature(byte[] data, List<SecretKey> signatureKeys, long counter)
data - Data to be signed.signatureKeys - Keys for computing the signature.counter - Counter / derived key index.public boolean validatePowerAuthSignature(byte[] data,
String signature,
List<SecretKey> signatureKeys,
long counter)
throws InvalidKeyException
data - Data that were signed.signature - Data signature.signatureKeys - Keys for signature validation.counter - Counter.InvalidKeyException - In case invalid key is provided.Copyright © 2016 Lime - HighTech Solutions Inc.. All rights reserved.