Constructors
Rsa()
Methods
loadPrivateKey(String,String)
Loads a private key. The password is optional and should be specified if needed. This method must be called in prior to creating a signature.loadPublicKey(String)
Loads a public key. This method must be called in prior to creating a signature.createSignature(Byte[],Integer)
This method will take an array of binary data and create a RSA signature using the provided hashing algorithm. The signature is returned as a byte array. The private key must be loaded prior to calling this method.Hashing algorithm:
createSignature(String,Integer)
This method takes a string of data and create a RSA signature using the provided hashing algorithm. This method is provided as a convenient way to create signatures for string data. Note that the string must be in UTF-8 encoding. If it is not, you need to use the more universal method taking a byte array as input. The private key must be loaded prior to calling this method.Hashing algorithm:
verifySignature(Byte[],Byte[],Integer)
This method will try to verify the RSA signature given the data and return if it was a success or not. Although you should pass in the hashing algorithm, the underlying code will try other algorithms if the signature does not pass the provided algorithm. This might change in the future, so you should specify the correct algorithm. The public key must be loaded prior to calling this method.Hashing algorithm:
verifySignature(String,Byte[],Integer)
This method will try to verify the RSA signature given the data and return if it was a success or not. Note that the string must be in UTF-8 encoding. If it is not, you need to use the more universal method taking a byte array as input. Although you should pass in the hashing algorithm, the underlying code will try other algorithms if the signature does not pass the provided algorithm. This might change in the future, so you should specify the correct algorithm. The public key must be loaded prior to calling this method.Hashing algorithm: