Class AsymmetricDSTU4145PrivateKey

java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricDSTU4145Key
org.bouncycastle.crypto.asymmetric.AsymmetricDSTU4145PrivateKey
All Implemented Interfaces:
Destroyable, AsymmetricKey, AsymmetricPrivateKey, Key

public final class AsymmetricDSTU4145PrivateKey extends AsymmetricDSTU4145Key implements AsymmetricPrivateKey
Class for DSTU-4145 private keys.
  • Constructor Details

    • AsymmetricDSTU4145PrivateKey

      public AsymmetricDSTU4145PrivateKey(Algorithm algorithm, DSTU4145Parameters parameters, BigInteger s)
    • AsymmetricDSTU4145PrivateKey

      public AsymmetricDSTU4145PrivateKey(Algorithm ecAlg, byte[] encoding)
    • AsymmetricDSTU4145PrivateKey

      public AsymmetricDSTU4145PrivateKey(Algorithm ecAlg, PrivateKeyInfo privateKeyInfo)
  • Method Details

    • getEncoded

      public final byte[] getEncoded()
      Description copied from interface: AsymmetricKey
      Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
      Specified by:
      getEncoded in interface AsymmetricKey
      Returns:
      an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
    • getAlgorithm

      public final Algorithm getAlgorithm()
      Return the algorithm this DSTU4145 key is for.
      Specified by:
      getAlgorithm in interface Key
      Overrides:
      getAlgorithm in class AsymmetricDSTU4145Key
      Returns:
      the key's algorithm.
    • getParameters

      public final DSTU4145Parameters getParameters()
      Return the domain parameters for this DSTU4145 key.
      Overrides:
      getParameters in class AsymmetricDSTU4145Key
      Returns:
      the DSTU4145 domain parameters.
    • getS

      public final BigInteger getS()
    • destroy

      public void destroy()
      Specified by:
      destroy in interface Destroyable
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface Destroyable
    • equals

      public boolean equals(Object o)
      Description copied from interface: Key
      Return true if o is an equivalent key to this.
      Specified by:
      equals in interface Key
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare to.
      Returns:
      true if o is the same or equivalent key, false otherwise.
    • hashCode

      public int hashCode()
      Description copied from interface: Key
      Return the hashCode for the key.
      Specified by:
      hashCode in interface Key
      Overrides:
      hashCode in class Object
      Returns:
      the key's hashCode.