public class PowerAuthClientActivation extends Object
| Constructor and Description |
|---|
PowerAuthClientActivation() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
computeApplicationSignature(String activationIdShort,
byte[] activationNonce,
byte[] encryptedDevicePublicKey,
byte[] applicationKey,
byte[] applicationSecret)
Method computes the signature of the activation data in order to prove that a correct
client application is attempting to complete the activation.
|
int |
computeDevicePublicKeyFingerprint(PublicKey devicePublicKey)
Compute a fingerprint of the device public key.
|
PublicKey |
decryptServerPublicKey(byte[] C_serverPublicKey,
PrivateKey devicePrivateKey,
PublicKey ephemeralPublicKey,
String activationOTP,
String activationIdShort,
byte[] activationNonce)
Decrypt server public key using activation OTP and device private key.
|
byte[] |
encryptDevicePublicKey(PublicKey devicePublicKey,
PrivateKey clientEphemeralPrivateKey,
PublicKey masterPublicKey,
String activationOTP,
String activationIdShort,
byte[] activationNonce)
Encrypt a device public key using the activation OTP.
|
byte[] |
generateActivationNonce()
Generate a new activation nonce.
|
KeyPair |
generateDeviceKeyPair()
Generate a device related activation key pair.
|
ActivationStatusBlobInfo |
getStatusFromEncryptedBlob(byte[] cStatusBlob,
SecretKey transportKey)
Returns an activation status from the encrypted activation blob as described in PowerAuth 2.0 Specification.
|
boolean |
verifyActivationDataSignature(String activationIdShort,
String activationOTP,
byte[] signature,
PublicKey masterPublicKey)
Verify the signature of activation data using Master Public Key.
|
boolean |
verifyServerDataSignature(String activationId,
byte[] C_serverPublicKey,
byte[] signature,
PublicKey masterPublicKey)
Verify signature of the encrypted activation ID and server public key
using a Master Public Key.
|
public boolean verifyActivationDataSignature(String activationIdShort, String activationOTP, byte[] signature, PublicKey masterPublicKey) throws InvalidKeyException
activationIdShort - Short activation ID.activationOTP - Activation OTP value.signature - Activation data signature.masterPublicKey - Master Public Key.InvalidKeyException - If provided master public key is invalid.public KeyPair generateDeviceKeyPair()
public byte[] generateActivationNonce()
public byte[] computeApplicationSignature(String activationIdShort, byte[] activationNonce, byte[] encryptedDevicePublicKey, byte[] applicationKey, byte[] applicationSecret)
activationIdShort - Short activation ID.activationNonce - Client activation nonce.encryptedDevicePublicKey - Encrypted device public key.applicationKey - Application identifier.applicationSecret - Application secret.public byte[] encryptDevicePublicKey(PublicKey devicePublicKey, PrivateKey clientEphemeralPrivateKey, PublicKey masterPublicKey, String activationOTP, String activationIdShort, byte[] activationNonce) throws InvalidKeyException
devicePublicKey - Device public key to be encrypted.clientEphemeralPrivateKey - Ephemeral private key.masterPublicKey - Master public key.activationOTP - Activation OTP value.activationIdShort - Short activation ID.activationNonce - Activation nonce, used as an initialization vector for AES encryption.InvalidKeyException - In case provided public key is invalid.public boolean verifyServerDataSignature(String activationId, byte[] C_serverPublicKey, byte[] signature, PublicKey masterPublicKey) throws InvalidKeyException, UnsupportedEncodingException
activationId - Activation IDC_serverPublicKey - Encrypted server public key.signature - Encrypted server public key signature.masterPublicKey - Master Public Key.InvalidKeyException - If provided master public key is invalid.UnsupportedEncodingException - In case system does not support UTF-8 encoding.public PublicKey decryptServerPublicKey(byte[] C_serverPublicKey, PrivateKey devicePrivateKey, PublicKey ephemeralPublicKey, String activationOTP, String activationIdShort, byte[] activationNonce) throws InvalidKeyException
C_serverPublicKey - Encrypted server public key.devicePrivateKey - Device private key.ephemeralPublicKey - Ephemeral public key.activationOTP - Activation OTP value.activationIdShort - Short activation OTP.activationNonce - Activation nonce, used as an initialization vector for AES encryption.InvalidKeyException - In case some of the provided keys is invalid.public int computeDevicePublicKeyFingerprint(PublicKey devicePublicKey)
devicePublicKey - Public key for computing fingerprint.public ActivationStatusBlobInfo getStatusFromEncryptedBlob(byte[] cStatusBlob, SecretKey transportKey) throws InvalidKeyException
cStatusBlob - Encrypted activation status blobtransportKey - A key used to protect the transport.InvalidKeyException - When invalid key is provided.Copyright © 2016 Lime - HighTech Solutions Inc.. All rights reserved.