Class OxalisCipherConverter
- java.lang.Object
-
- network.oxalis.statistics.security.OxalisCipherConverter
-
public class OxalisCipherConverter extends Object
- Author:
- steinar Date: 14.05.13 Time: 09:57
-
-
Constructor Summary
Constructors Constructor Description OxalisCipherConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OxalisCiphercreateCipherFromWrappedHexKey(String wrappedSymmetricKeyAsHexString, PrivateKey privateKey)Creates an instance of OxalisCipher: Decodes the supplied hex string representation of a wrapped key into an array of bytes representation Creates a cipher, which is initialized with a private key Unwraps (decrypts) the secret key represented by an array of bytes into a SecretKey Creates an OxalisCipher using the unwrapped SecretKeyStringgetWrappedSymmetricKeyAsString(PublicKey publicKey, OxalisCipher oxalisCipher)Encrypts the secret key (symmetric key) held inside the OxalisCipher instance using the supplied PublicKey, after which the resulting wrapped secret key is transformed into a hex string suitable for transmission, persistence etc.
-
-
-
Method Detail
-
createCipherFromWrappedHexKey
public OxalisCipher createCipherFromWrappedHexKey(String wrappedSymmetricKeyAsHexString, PrivateKey privateKey)
Creates an instance of OxalisCipher:- Decodes the supplied hex string representation of a wrapped key into an array of bytes representation
- Creates a cipher, which is initialized with a private key
- Unwraps (decrypts) the secret key represented by an array of bytes into a SecretKey
- Creates an OxalisCipher using the unwrapped SecretKey
-
getWrappedSymmetricKeyAsString
public String getWrappedSymmetricKeyAsString(PublicKey publicKey, OxalisCipher oxalisCipher)
Encrypts the secret key (symmetric key) held inside the OxalisCipher instance using the supplied PublicKey, after which the resulting wrapped secret key is transformed into a hex string suitable for transmission, persistence etc.- Parameters:
publicKey- the public asymmetric key to use for encrypting the secret symmetric keyoxalisCipher- the instance of OxalisCipher in which the secret symmetric key is held.- Returns:
-
-