gov.lanl.MakeTestKeys
Class MakeRSAKeys

java.lang.Object
  |
  +--gov.lanl.MakeTestKeys.MakeRSAKeys

public class MakeRSAKeys
extends java.lang.Object

This class makes a private/public key pair, encrypts the private key with the password, writes out the private key and a certificate with the pub keys to a floppy disk as well as a encrypted (with the private key) string. The keys are written with the user name for the file name and .prv or .pub extensions

 

Constructor Summary
MakeRSAKeys()
           
 
Method Summary
 iaik.x509.X509Certificate createCertificate(iaik.asn1.structures.Name subject, java.security.PublicKey pk, iaik.asn1.structures.Name issuer, java.security.PrivateKey sk, iaik.asn1.structures.AlgorithmID algorithm, boolean extensions)
           
 void createDirAndWriteData()
          Creates a directory named loginName and write the data.txt file
 void encryptAndWrite(java.io.File thefile, javax.crypto.Cipher theCipher, byte[] sample, int blksize)
           
 java.security.KeyPair generateKeyPair(java.lang.String algorithm, int numbits)
           
 void generateRSAKeyDisk()
           
static void main(java.lang.String[] arg)
          Performs certificate creation and verification tests.
 void writeEncryptedRSASamples(iaik.security.rsa.RSAPrivateKey pk, iaik.security.rsa.RSAPublicKey pubk)
           
 void writeX509Certificate(iaik.security.rsa.RSAPrivateKey pk, iaik.security.rsa.RSAPublicKey pubk)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MakeRSAKeys

public MakeRSAKeys()
Method Detail

generateKeyPair

public java.security.KeyPair generateKeyPair(java.lang.String algorithm,
                                             int numbits)

createCertificate

public iaik.x509.X509Certificate createCertificate(iaik.asn1.structures.Name subject,
                                                   java.security.PublicKey pk,
                                                   iaik.asn1.structures.Name issuer,
                                                   java.security.PrivateKey sk,
                                                   iaik.asn1.structures.AlgorithmID algorithm,
                                                   boolean extensions)

writeX509Certificate

public void writeX509Certificate(iaik.security.rsa.RSAPrivateKey pk,
                                 iaik.security.rsa.RSAPublicKey pubk)

encryptAndWrite

public void encryptAndWrite(java.io.File thefile,
                            javax.crypto.Cipher theCipher,
                            byte[] sample,
                            int blksize)

writeEncryptedRSASamples

public void writeEncryptedRSASamples(iaik.security.rsa.RSAPrivateKey pk,
                                     iaik.security.rsa.RSAPublicKey pubk)

generateRSAKeyDisk

public void generateRSAKeyDisk()

createDirAndWriteData

public void createDirAndWriteData()
Creates a directory named loginName and write the data.txt file


main

public static void main(java.lang.String[] arg)
                 throws java.io.IOException
Performs certificate creation and verification tests.

Throws:
java.io.IOException - if an I/O Error occurs