edu.vt.middleware.crypt.io
Class SecretKeyCredentialReader

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

public class SecretKeyCredentialReader
extends Object
implements CredentialReader<SecretKey>

Reads symmetric algorithm secret keys.

Version:
$Revision: 2744 $
Author:
Middleware Services

Constructor Summary
SecretKeyCredentialReader(String cipherAlgorithm)
          Creates a new instance that can read keys for the given symmetric cipher algorithm.
 
Method Summary
 SecretKey read(File file)
          Reads a credential, commonly in encoded format, from the given file.
 SecretKey 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

SecretKeyCredentialReader

public SecretKeyCredentialReader(String cipherAlgorithm)
Creates a new instance that can read keys for the given symmetric cipher algorithm.

Parameters:
cipherAlgorithm - Cipher algorithm name, e.g. AES.
Method Detail

read

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

Specified by:
read in interface CredentialReader<SecretKey>
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 SecretKey read(InputStream in)
               throws IOException,
                      CryptException
Reads a credential, commonly in encoded format, from the given input stream.

Specified by:
read in interface CredentialReader<SecretKey>
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-2013 Virginia Tech. All Rights Reserved.