Class CipherSpec

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

public class CipherSpec extends AbstractBlock implements Serializable

Represents a the Blending specification of the cipher specification including usage.

See Also:
  • Field Details

  • Constructor Details

    • CipherSpec

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

      Create object from ASN.1 code.

      Parameters:
      to - the ASN.1 code
      Throws:
      IOException - if parsing of ASN.1 code fails
    • CipherSpec

      public CipherSpec(CipherUsage cipherUsage)
  • Method Details

    • parse

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

      public AsymmetricAlgorithmSpec getAsymmetricSpec()
    • setAsymmetricSpec

      public AsymmetricAlgorithmSpec setAsymmetricSpec(AsymmetricAlgorithmSpec spec)

      Sets the specification for an asymmetric key.

      Parameters:
      spec - the specification to be set
      Returns:
      the previously set specification
    • getSymmetricSpec

      public SymmetricAlgorithmSpec getSymmetricSpec()
    • setSymmetricSpec

      public SymmetricAlgorithmSpec setSymmetricSpec(SymmetricAlgorithmSpec spec)

      Sets the specification for an symmetric key.

      Parameters:
      spec - the specification to be set
      Returns:
      the previously set specification
    • getMacSpec

      public MacAlgorithmSpec getMacSpec()
    • setMacSpec

      public MacAlgorithmSpec setMacSpec(MacAlgorithmSpec spec)

      Sets the specification for an mac algorithm.

      Parameters:
      spec - the specification to be set
      Returns:
      the previously set specification
    • getCipherUsage

      public CipherUsage getCipherUsage()
    • setCipherUsage

      public CipherUsage setCipherUsage(CipherUsage usage)

      Sets the usage type for the cypher specified in this set.

      Parameters:
      usage - the usage to be set
      Returns:
      the previously set usage
    • dumpValueNotation

      public String dumpValueNotation(String prefix, DumpType dumpType) throws IOException
      Specified by:
      dumpValueNotation in interface Block
      Throws:
      IOException
    • toAsn1Object

      public org.bouncycastle.asn1.ASN1Object toAsn1Object(DumpType dumpType) throws IOException
      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
      Throws:
      IOException - if dumping of the object fails due to an illegal internal state of the object
    • equals

      public boolean equals(Object t)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object