public class PowerAuthServerActivation extends Object
| Constructor and Description |
|---|
PowerAuthServerActivation() |
| Modifier and Type | Method and Description |
|---|---|
int |
computeDevicePublicKeyFingerprint(PublicKey devicePublicKey)
Compute a fingerprint of the device public key.
|
byte[] |
computeServerDataSignature(String activationId,
byte[] C_serverPublicKey,
PrivateKey masterPrivateKey)
Compute an activation ID and encrypted server public key signature
using the Master Private Key.
|
PublicKey |
decryptDevicePublicKey(byte[] C_devicePublicKey,
String activationIdShort,
PrivateKey masterPrivateKey,
PublicKey ephemeralPublicKey,
String activationOTP,
byte[] activationNonce)
Decrypt the device public key using activation OTP.
|
byte[] |
encryptedStatusBlob(byte statusByte,
long counter,
byte failedAttempts,
byte maxFailedAttempts,
SecretKey transportKey)
Returns an encrypted status blob as described in PowerAuth 2.0 Specification.
|
byte[] |
encryptServerPublicKey(PublicKey serverPublicKey,
PublicKey devicePublicKey,
PrivateKey ephemeralPrivateKey,
String activationOTP,
String activationIdShort,
byte[] activationNonce)
Encrypt the server public key using activation OTP and device public key.
|
String |
generateActivationId()
Generate a pseudo-unique activation ID.
|
String |
generateActivationIdShort()
Generate a pseudo-unique short activation ID.
|
byte[] |
generateActivationNonce()
Generate a new server activation nonce.
|
String |
generateActivationOTP()
Generate a pseudo-unique activation OTP.
|
byte[] |
generateActivationSignature(String activationIdShort,
String activationOTP,
PrivateKey masterPrivateKey)
Generate signature for the activation data.
|
KeyPair |
generateServerKeyPair()
Generate a server related activation key pair.
|
boolean |
validateApplicationSignature(String activationIdShort,
byte[] activationNonce,
byte[] encryptedDevicePublicKey,
byte[] applicationKey,
byte[] applicationSecret,
byte[] signature)
Method validates the signature of the activation data in order to prove that a correct
client application is attempting to complete the activation.
|
public String generateActivationId()
public String generateActivationIdShort()
public String generateActivationOTP()
public KeyPair generateServerKeyPair()
public byte[] generateActivationSignature(String activationIdShort, String activationOTP, PrivateKey masterPrivateKey) throws InvalidKeyException
activationIdShort - Short activation ID.activationOTP - Activation OTP value.masterPrivateKey - Master Private Key.InvalidKeyException - In case Master Private Key is invalid.public byte[] generateActivationNonce()
public boolean validateApplicationSignature(String activationIdShort, byte[] activationNonce, byte[] encryptedDevicePublicKey, byte[] applicationKey, byte[] applicationSecret, byte[] signature)
activationIdShort - Short activation ID.activationNonce - Client activation nonce.encryptedDevicePublicKey - Encrypted device public key.applicationKey - Application identifier.applicationSecret - Application secret.signature - Signature to be checked against.public PublicKey decryptDevicePublicKey(byte[] C_devicePublicKey, String activationIdShort, PrivateKey masterPrivateKey, PublicKey ephemeralPublicKey, String activationOTP, byte[] activationNonce)
C_devicePublicKey - Encrypted device public key.activationIdShort - Short activation ID.masterPrivateKey - Server master private key.ephemeralPublicKey - Ephemeral public key.activationOTP - Activation OTP value.activationNonce - Activation nonce, used as an initialization vector
for AES encryption.public byte[] encryptServerPublicKey(PublicKey serverPublicKey, PublicKey devicePublicKey, PrivateKey ephemeralPrivateKey, String activationOTP, String activationIdShort, byte[] activationNonce) throws InvalidKeyException
serverPublicKey - Server public key to be encrypted.devicePublicKey - Device public key used for encryption.ephemeralPrivateKey - Ephemeral private key.activationOTP - Activation OTP value.activationIdShort - Short activation ID.activationNonce - Activation nonce, used as an initialization vector
for AES encryption.InvalidKeyException - In case some of the provided keys is invalid.public byte[] encryptedStatusBlob(byte statusByte,
long counter,
byte failedAttempts,
byte maxFailedAttempts,
SecretKey transportKey)
throws InvalidKeyException
statusByte - Byte determining the status of the activation.counter - Bytes with a counter information.failedAttempts - Number of failed attempts at the moment.maxFailedAttempts - Number of allowed failed attempts.transportKey - A key used to protect the transport.InvalidKeyException - When invalid key is provided.public byte[] computeServerDataSignature(String activationId, byte[] C_serverPublicKey, PrivateKey masterPrivateKey) throws InvalidKeyException, UnsupportedEncodingException
activationId - Activation IDC_serverPublicKey - Encrypted server public key.masterPrivateKey - Master Private Key.InvalidKeyException - If master private key is invalid.UnsupportedEncodingException - In case UTF-8 is not supported on the system.public int computeDevicePublicKeyFingerprint(PublicKey devicePublicKey)
devicePublicKey - Public key for computing fingerprint.Copyright © 2016 Lime - HighTech Solutions Inc.. All rights reserved.