|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.util.CryptWriter
public final class CryptWriter
Helper class for performing I/O write operations on cryptographic data.
| Constructor Summary | |
|---|---|
protected |
CryptWriter()
Protected constructor of utility class. |
| Method Summary | |
|---|---|
static void |
writeEncodedCertificate(Certificate cert,
File file)
Writes the supplied certificate to the file using its native encoding. |
static void |
writeEncodedCertificate(Certificate cert,
OutputStream out)
Writes the supplied certificate to the output stream using its native encoding. |
static void |
writeEncodedCertificates(Certificate[] certs,
File file)
Writes the supplied certificates in sequence to the file using their native encoding. |
static void |
writeEncodedCertificates(Certificate[] certs,
OutputStream out)
Writes the supplied certificates in sequence to the output stream using their native encoding. |
static void |
writeEncodedKey(Key key,
File file)
Writes the supplied key to the file using its native encoding. |
static void |
writeEncodedKey(Key key,
OutputStream out)
Writes the supplied key to the output stream using its native encoding. |
static void |
writePemCertificate(Certificate cert,
File file)
Writes the supplied certificate to the supplied file in PEM format. |
static void |
writePemCertificate(Certificate cert,
OutputStream out)
Writes the supplied certificate to the supplied output stream in PEM format. |
static void |
writePemCertificates(Certificate[] certs,
File file)
Writes the concatenation of the given certificates in PEM format to the given file. |
static void |
writePemCertificates(Certificate[] certs,
OutputStream out)
Writes the concatenation of the given certificates in PEM format to the given output stream. |
static void |
writePemKey(PrivateKey key,
char[] password,
SecureRandom random,
File file)
Writes the supplied private key to the supplied file in encrypted PEM format. |
static void |
writePemKey(PrivateKey key,
char[] password,
SecureRandom random,
OutputStream out)
Writes the supplied private key to the supplied output stream in PEM format. |
static void |
writePemKey(PublicKey key,
File file)
Writes the supplied public key to the supplied file in PEM format. |
static void |
writePemKey(PublicKey key,
OutputStream out)
Writes the supplied public key to the supplied output stream in PEM format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected CryptWriter()
| Method Detail |
|---|
public static void writeEncodedKey(Key key,
File file)
throws IOException
writeEncodedKey(Key, OutputStream) for more information.
key - Key to write to file.file - Output file descriptor.
IOException - On write errors.
public static void writeEncodedKey(Key key,
OutputStream out)
throws IOException
SecretKey - RAW format consisting of unmodified key
material bytes.PrivateKey - DER-encoded PKCS#8 format key.PublicKey - DER-encoded X.509 format key.
key - Key to write.out - Ouput stream to write key data to.
IOException - On write errors.
public static void writePemKey(PublicKey key,
File file)
throws IOException
key - Public key to write to file.file - Output file descriptor.
IOException - On write errors.
public static void writePemKey(PublicKey key,
OutputStream out)
throws IOException
key - Public key to write to file.out - Ouput stream to write key data to.
IOException - On write errors.
public static void writePemKey(PrivateKey key,
char[] password,
SecureRandom random,
File file)
throws IOException
key - Private key to write to file.password - Password used to encrypt private key using 256-bit AES
encryption; may be null to indicate no encryption.random - Secure random provider used for encrypting private key.file - Output file descriptor.
IOException - On write errors.
public static void writePemKey(PrivateKey key,
char[] password,
SecureRandom random,
OutputStream out)
throws IOException
key - Private key to write to file.password - Password used to encrypt private key using 256-bit AES
encryption; may be null to indicate no encryption.random - Secure random provider used for encrypting private key.out - Ouput stream to write key data to.
IOException - On write errors.
public static void writeEncodedCertificate(Certificate cert,
File file)
throws CryptException,
IOException
cert - Certificate to write to file.file - Output file descriptor.
IOException - On write errors.
CryptException - If the given cert cannot be decoded to bytes.
public static void writeEncodedCertificate(Certificate cert,
OutputStream out)
throws CryptException,
IOException
cert - Certificate to write to file.out - Ouput stream to write cert data to.
IOException - On write errors.
CryptException - If the given cert cannot be decoded to bytes.
public static void writePemCertificate(Certificate cert,
File file)
throws IOException
cert - Certificate to write to file.file - Output file descriptor.
IOException - On write errors.
public static void writePemCertificate(Certificate cert,
OutputStream out)
throws IOException
cert - Certificate to write to the output stream.out - Ouput stream to write cert data to.
IOException - On write errors.
public static void writeEncodedCertificates(Certificate[] certs,
File file)
throws CryptException,
IOException
certs - Certificates to write to file.file - Output file descriptor.
IOException - On write errors.
CryptException - If the given cert cannot be decoded to bytes.
public static void writeEncodedCertificates(Certificate[] certs,
OutputStream out)
throws CryptException,
IOException
certs - Certificates to write to the output stream.out - Ouput stream to write cert data to.
IOException - On write errors.
CryptException - If the given cert cannot be decoded to bytes.
public static void writePemCertificates(Certificate[] certs,
File file)
throws IOException
certs - Certificates to write to file.file - Output file descriptor.
IOException - On write errors.
public static void writePemCertificates(Certificate[] certs,
OutputStream out)
throws IOException
certs - Certificates to write to the output stream.out - Ouput stream to write cert data to.
IOException - On write errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||