intarsys runtime library

de.intarsys.tools.digest
Class StandardDigestEnvironment

java.lang.Object
  extended by de.intarsys.tools.digest.StandardDigestEnvironment
All Implemented Interfaces:
IDigestEnvironment

public class StandardDigestEnvironment
extends Object
implements IDigestEnvironment

The standard implementation for IDigestEnvironment.


Constructor Summary
StandardDigestEnvironment()
           
 
Method Summary
 IDigest createDigest(String algorithmName, byte[] bytes)
          An IDigest object from an algorithm name and the raw bytes.
 IDigester createDigester(String algorithmName)
          An IDigester for the given "algorithmName".
 IDigest decode(byte[] bytes)
          Decode an DER encoded representation to an IDigest.
 byte[] encode(IDigest digest)
          Encode an IDigest to a DER representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardDigestEnvironment

public StandardDigestEnvironment()
Method Detail

createDigest

public IDigest createDigest(String algorithmName,
                            byte[] bytes)
Description copied from interface: IDigestEnvironment
An IDigest object from an algorithm name and the raw bytes.

Specified by:
createDigest in interface IDigestEnvironment
Returns:
An IDigest object from an algorithm name and the raw bytes.

createDigester

public IDigester createDigester(String algorithmName)
                         throws NoSuchAlgorithmException
Description copied from interface: IDigestEnvironment
An IDigester for the given "algorithmName".

Specified by:
createDigester in interface IDigestEnvironment
Returns:
An IDigester for the given "algorithmName".
Throws:
NoSuchAlgorithmException

decode

public IDigest decode(byte[] bytes)
               throws IOException
Description copied from interface: IDigestEnvironment
Decode an DER encoded representation to an IDigest.

Specified by:
decode in interface IDigestEnvironment
Returns:
The decoded IDigest
Throws:
IOException - If no decoder installed or "bytes" are not a correct encoded DER representation.

encode

public byte[] encode(IDigest digest)
              throws IOException
Description copied from interface: IDigestEnvironment
Encode an IDigest to a DER representation.

Specified by:
encode in interface IDigestEnvironment
Returns:
The DER encoded IDigest
Throws:
IOException - If no decoder installed.

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.