| Constructor and Description |
|---|
Crypto(String user)
Constructor for validators
- use isValid to check that the decrypted signature matches the provided user id
|
Crypto(String user,
boolean create)
Constructor for requesters
- getSignature returns the the encrypted userid
|
public Crypto(String user, boolean create) throws CryptoException
user - - user making the requestcreate - - if true create the public & private keys if missingCryptoExceptionpublic Crypto(String user) throws CryptoException
user - - user claiming to make the requestCryptoExceptionpublic byte[] encrypt(Object o) throws CryptoException
encrypt in interface ICryptoCryptoExceptionpublic byte[] getSignature()
throws CryptoException
CryptoExceptionpublic boolean isValid(byte[] signature)
throws CryptoException
CryptoExceptionpublic Object decrypt(byte[] byteArray) throws CryptoException
decrypt in interface ICryptoCryptoExceptionpublic static void main(String[] args) throws CryptoException
CryptoExceptionCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.