Class MacAlgorithm

java.lang.Object
net.messagevortex.asn1.AbstractBlock
net.messagevortex.asn1.MacAlgorithm
All Implemented Interfaces:
Serializable, Block, Dumpable

public class MacAlgorithm extends AbstractBlock implements Serializable

Represents a Mac Algorithm as ASN.1 structure.

See Also:
  • Field Details

  • Constructor Details

    • MacAlgorithm

      public MacAlgorithm()
    • MacAlgorithm

      public MacAlgorithm(org.bouncycastle.asn1.ASN1Encodable to) throws IOException

      constructor to creates a mac algorith from an ASN.1 encoded object.

      Parameters:
      to - the object description in ASN.1 notation
      Throws:
      IOException - if an error occures during parsing
      NullPointerException - if object is null
    • MacAlgorithm

      public MacAlgorithm(Algorithm a) throws IOException

      constructor to creates a mac algorith from an ASN.1 encoded object.

      Parameters:
      a - the object description in ASN.1 notation
      Throws:
      IOException - if an error occures during parsing
      NullPointerException - if object is null
  • Method Details

    • parse

      protected final void parse(org.bouncycastle.asn1.ASN1Encodable to) throws IOException
      Specified by:
      parse in class AbstractBlock
      Throws:
      IOException
    • toAsn1Object

      public org.bouncycastle.asn1.ASN1Object toAsn1Object(DumpType dumpType)
      Description copied from interface: Dumpable

      Dumps an ASN.1 representation of the object.

      Specified by:
      toAsn1Object in interface Dumpable
      Parameters:
      dumpType - the dump type to be used
      Returns:
      the ASN.1 string representation of the object
    • dumpValueNotation

      public String dumpValueNotation(String prefix, DumpType dumpType)
      Specified by:
      dumpValueNotation in interface Block
    • setAlgorithm

      public Algorithm setAlgorithm(Algorithm alg) throws IOException

      Sets the algorithm.

      Parameters:
      alg - the algorithm to be used
      Returns:
      the previously set algorithm
      Throws:
      IOException - if algorithm is not of the correct type
    • getAlgorithm

      public Algorithm getAlgorithm()