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
- Version:
- 4/13/98
- Author:
- Jim George
|
Method Summary |
X509Certificate |
createCertificate(Name subject,
java.security.PublicKey pk,
Name issuer,
java.security.PrivateKey sk,
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(RSAPrivateKey pk,
RSAPublicKey pubk)
|
void |
writeX509Certificate(RSAPrivateKey pk,
RSAPublicKey pubk)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MakeRSAKeys
public MakeRSAKeys()
generateKeyPair
public java.security.KeyPair generateKeyPair(java.lang.String algorithm,
int numbits)
createCertificate
public X509Certificate createCertificate(Name subject,
java.security.PublicKey pk,
Name issuer,
java.security.PrivateKey sk,
AlgorithmID algorithm,
boolean extensions)
writeX509Certificate
public void writeX509Certificate(RSAPrivateKey pk,
RSAPublicKey pubk)
encryptAndWrite
public void encryptAndWrite(java.io.File thefile,
javax.crypto.Cipher theCipher,
byte[] sample,
int blksize)
writeEncryptedRSASamples
public void writeEncryptedRSASamples(RSAPrivateKey pk,
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
Copyright © 2000 Apache Software Foundation. All Rights Reserved.