Class AsymmetricCryptography
- java.lang.Object
-
- com.ulisesbocchio.jasyptspringboot.util.AsymmetricCryptography
-
public class AsymmetricCryptography extends Object
AsymmetricCryptography class.
- Version:
- $Id: $Id
- Author:
- Sergio.U.Bocchio
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsymmetricCryptography.KeyFormat
-
Constructor Summary
Constructors Constructor Description AsymmetricCryptography(org.springframework.core.io.ResourceLoader resourceLoader)Constructor for AsymmetricCryptography.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] msg, PrivateKey key)decrypt.byte[]encrypt(byte[] msg, PublicKey key)encrypt.PrivateKeygetPrivateKey(String resourceLocation, AsymmetricCryptography.KeyFormat format)getPrivateKey.PrivateKeygetPrivateKey(org.springframework.core.io.Resource resource, AsymmetricCryptography.KeyFormat format)getPrivateKey.PublicKeygetPublicKey(String resourceLocation, AsymmetricCryptography.KeyFormat format)getPublicKey.PublicKeygetPublicKey(org.springframework.core.io.Resource resource, AsymmetricCryptography.KeyFormat format)getPublicKey.
-
-
-
Method Detail
-
getPrivateKey
public PrivateKey getPrivateKey(String resourceLocation, AsymmetricCryptography.KeyFormat format)
getPrivateKey.
- Parameters:
resourceLocation- aStringobjectformat- aAsymmetricCryptography.KeyFormatobject- Returns:
- a
PrivateKeyobject
-
getPrivateKey
public PrivateKey getPrivateKey(org.springframework.core.io.Resource resource, AsymmetricCryptography.KeyFormat format)
getPrivateKey.
- Parameters:
resource- aResourceobjectformat- aAsymmetricCryptography.KeyFormatobject- Returns:
- a
PrivateKeyobject
-
getPublicKey
public PublicKey getPublicKey(String resourceLocation, AsymmetricCryptography.KeyFormat format)
getPublicKey.
- Parameters:
resourceLocation- aStringobjectformat- aAsymmetricCryptography.KeyFormatobject- Returns:
- a
PublicKeyobject
-
getPublicKey
public PublicKey getPublicKey(org.springframework.core.io.Resource resource, AsymmetricCryptography.KeyFormat format)
getPublicKey.
- Parameters:
resource- aResourceobjectformat- aAsymmetricCryptography.KeyFormatobject- Returns:
- a
PublicKeyobject
-
encrypt
public byte[] encrypt(byte[] msg, PublicKey key)encrypt.
- Parameters:
msg- an array ofbyteobjectskey- aPublicKeyobject- Returns:
- an array of
byteobjects
-
decrypt
public byte[] decrypt(byte[] msg, PrivateKey key)decrypt.
- Parameters:
msg- an array ofbyteobjectskey- aPrivateKeyobject- Returns:
- an array of
byteobjects
-
-