Package kz.greetgo.security.crypto
Class CryptoBridge
java.lang.Object
kz.greetgo.security.crypto.CryptoBridge
- All Implemented Interfaces:
Crypto
public class CryptoBridge extends java.lang.Object implements Crypto
-
Field Summary
Fields Modifier and Type Field Description static CryptoTracetrace -
Constructor Summary
Constructors Constructor Description CryptoBridge(CryptoSource cryptoSource) -
Method Summary
Modifier and Type Method Description byte[]decrypt(byte[] encryptedBytes)Decrypt encrypted data using private keybyte[]encrypt(byte[] bytes)Encrypt data using public keybyte[]makeHash(byte[] sourceBytes)Generate hashjava.security.SecureRandomrnd()Gives security random generatorbyte[]sign(byte[] bytes)Sign databooleanverifySignature(byte[] bytes, byte[] signature)Verifies signature
-
Field Details
-
Constructor Details
-
Method Details
-
encrypt
public byte[] encrypt(byte[] bytes)Description copied from interface:CryptoEncrypt data using public key -
decrypt
public byte[] decrypt(byte[] encryptedBytes)Description copied from interface:CryptoDecrypt encrypted data using private key -
sign
public byte[] sign(byte[] bytes)Description copied from interface:CryptoSign data -
verifySignature
public boolean verifySignature(byte[] bytes, byte[] signature)Description copied from interface:CryptoVerifies signature- Specified by:
verifySignaturein interfaceCrypto- Parameters:
bytes- checking datasignature- verifying signature- Returns:
- verification result:
true- verification is OK, otherwise - verification wrong
-
makeHash
public byte[] makeHash(byte[] sourceBytes)Description copied from interface:CryptoGenerate hash -
rnd
public java.security.SecureRandom rnd()Description copied from interface:CryptoGives security random generator
-