Class EciesUtils
java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.EciesUtils
A utility class for handling ECIES data.
- Author:
- Roman Strobl, roman.strobl@wultra.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]deriveAssociatedData(EncryptorScope scope, String protocolVersion, String applicationKey, String activationId, String temporaryKeyId) Derive associated data for ECIES.static byte[]deriveSharedInfo2(String protocolVersion, byte[] sharedInfo2Base, byte[] ephemeralPublicKey, byte[] nonce, Long timestamp, byte[] associatedData) Derive final SharedInfo2 constant for ECIES encryption scheme.static byte[]deriveSharedInfo2Base(EncryptorScope scope, String applicationSecret, byte[] transportKey) Derive base for SharedInfo2 calculation for ECIES encryption scheme.static byte[]generateMacData(byte[] sharedInfo2, byte[] encryptedData) Generate MAC data for ECIES request or response MAC validation.static longGenerate timestamp for ECIES request/response.
-
Method Details
-
generateMacData
public static byte[] generateMacData(byte[] sharedInfo2, byte[] encryptedData) Generate MAC data for ECIES request or response MAC validation.- Parameters:
sharedInfo2- Parameter sharedInfo2 for ECIES.encryptedData- Encrypted data- Returns:
- Resolved MAC data.
-
generateTimestamp
public static long generateTimestamp()Generate timestamp for ECIES request/response.- Returns:
- Timestamp bytes to use for ECIES encryption.
-
deriveAssociatedData
public static byte[] deriveAssociatedData(EncryptorScope scope, String protocolVersion, String applicationKey, String activationId, String temporaryKeyId) throws EciesException Derive associated data for ECIES.- Parameters:
scope- Encryptor's scope.protocolVersion- Protocol version.applicationKey- Application key.activationId- Activation ID.temporaryKeyId- Temporary key ID.- Returns:
- Derived associated data.
- Throws:
EciesException- In case that activation ID is required but is missing.
-