Question
in JAVA : for this assignment we will be generating signatures and validating signatures using our ssh keys. we will be using RSA keys to
in JAVA :
for this assignment we will be generating signatures and validating signatures using our ssh keys. we will be using RSA keys to do the signing and validation.
you will want to use test ssh keys for RSA:
ssh-keygen -t rsa -f rsa_test
be sure to generate keys that aren't password protected!
you need to implement the following class: (please don't change the package name, class name, or method signatures)
NOTE: when generating signatures with RSA use "SHA256withRSA" .
public class BlobSigner { /** * generate a signature file (dstSignatureFile) for fileToSign using * sshPrivateKeyFile. * * * * * * @param fileToSign the file containing the data to be signed. * @param sshPrivateKeyFile the ssh private key file with the signing key * to use. * @param dstSignatureFile the file to write the generated signature to. * the signature will be base64 encoded. */ public static void signFile( File fileToSign, File sshPrivateKeyFile, File dstSignatureFile ) {}
/** * validate the signature file (signatureFile) corresponding to * signedFile using the public key in sshPublicKeyFile. * @param signedFile the file containing the data that was signed. * @param sshPublicKeyFile the file containing the public key corresponds * to the private key that was used to sign * signedFile. * @param signatureFile the base64 encoded signature generated with the * private key that corresponds to sshPublicKeyFile * over the data in the signedFile. * @return true if the signature is valid. */
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started