gov.lanl.TMCryptography
Class IButtonCrypto

java.lang.Object
  |
  +--gov.lanl.TMCryptography.IButtonCrypto
All Implemented Interfaces:
TMKeyCrypto

public class IButtonCrypto
extends java.lang.Object
implements TMKeyCrypto

IButtonCrypto uses iButton hardware to encrypt, decrypt

Version:
05/18/98
Author:
Jim George, Eugene Gavrilov

Field Summary
 
Fields inherited from interface gov.lanl.TMCryptography.TMKeyCrypto
USE_PRIVATE_KEY, USE_PUBLIC_KEY
 
Constructor Summary
IButtonCrypto()
          Constructor for building from a private key and public certificate
IButtonCrypto(java.lang.String userName)
          Constructor for building from a private key and public certificate
 
Method Summary
 byte[] decrypt(byte[] inmsg, int useWhichKey)
          Decrypts the input message by striping off whichkey
 byte[] encrypt(byte[] inmsg, int useWhichKey)
          Encrypts the input message using the specified key
 byte[] getPublicKeyCertificate()
          returns certificate as byte array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IButtonCrypto

public IButtonCrypto()
              throws TMCryptoException
Constructor for building from a private key and public certificate

Throws:
TMCryptoException

IButtonCrypto

public IButtonCrypto(java.lang.String userName)
              throws TMCryptoException
Constructor for building from a private key and public certificate

Parameters:
userName - real name of the user
Throws:
TMCryptoException
Method Detail

getPublicKeyCertificate

public byte[] getPublicKeyCertificate()
returns certificate as byte array

Specified by:
getPublicKeyCertificate in interface TMKeyCrypto
Returns:
public key certificate

encrypt

public byte[] encrypt(byte[] inmsg,
                      int useWhichKey)
Encrypts the input message using the specified key

Specified by:
encrypt in interface TMKeyCrypto
Parameters:
inmsg - the message to encrypt as a byte array
useWhichKey - the specifier as to which key to use
Returns:
the encrypted byte array

decrypt

public byte[] decrypt(byte[] inmsg,
                      int useWhichKey)
Decrypts the input message by striping off whichkey

Specified by:
decrypt in interface TMKeyCrypto
Parameters:
useWhichKey - the specifier as to which key to use
Returns:
the decrypted message as a byte array


Copyright © 2000 Apache Software Foundation. All Rights Reserved.