edu.vt.middleware.crypt.io
Class X509CertificateCredentialReader

java.lang.Object
  extended by edu.vt.middleware.crypt.io.X509CertificateCredentialReader
All Implemented Interfaces:
CredentialReader<X509Certificate>

public class X509CertificateCredentialReader
extends Object
implements CredentialReader<X509Certificate>

Reads X.509 certificates from encoded representation. Both PEM and DER encodings are supported.

Version:
$Revision: 1818 $
Author:
Middleware Services

Constructor Summary
X509CertificateCredentialReader()
           
 
Method Summary
 X509Certificate read(File file)
          Reads a credential, commonly in encoded format, from the given file.
 X509Certificate read(InputStream in)
          Reads a credential, commonly in encoded format, from the given input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X509CertificateCredentialReader

public X509CertificateCredentialReader()
Method Detail

read

public X509Certificate read(File file)
                     throws IOException,
                            CryptException
Reads a credential, commonly in encoded format, from the given file.

Specified by:
read in interface CredentialReader<X509Certificate>
Parameters:
file - File from which to read credential.
Returns:
Credential read from file.
Throws:
IOException - On IO exceptions.
CryptException - On cryptography errors such as invalid formats, unsupported ciphers, illegal settings.

read

public X509Certificate read(InputStream in)
                     throws IOException,
                            CryptException
Reads a credential, commonly in encoded format, from the given input stream.

Specified by:
read in interface CredentialReader<X509Certificate>
Parameters:
in - Input stream from which to read credential.
Returns:
Credential read from input stream.
Throws:
IOException - On IO exceptions.
CryptException - On cryptography errors such as invalid formats, unsupported ciphers, illegal settings.


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.