Class PrivateKeyInfo

java.lang.Object
org.mozilla.jss.pkix.primitive.PrivateKeyInfo
All Implemented Interfaces:
Serializable, Key, PrivateKey, Destroyable, ASN1Value

public class PrivateKeyInfo extends Object implements ASN1Value, PrivateKey
See Also:
  • Field Details

  • Constructor Details

    • PrivateKeyInfo

      public PrivateKeyInfo(INTEGER version, AlgorithmIdentifier privateKeyAlgorithm, OCTET_STRING privateKey, SET attributes)
      Create a PrivateKeyInfo from its components.
      Parameters:
      attributes - May be null if there are no attributes, in which case the attributes field will be omitted from the DER encoding. Each element must be a org.mozilla.jss.pkix.primitive.Attribute.
  • Method Details

    • getVersion

      public INTEGER getVersion()
    • getPrivateKeyAlgorithm

      public AlgorithmIdentifier getPrivateKeyAlgorithm()
    • getAlgorithm

      public String getAlgorithm()
      Specified by:
      getAlgorithm in interface Key
    • getFormat

      public String getFormat()
      Specified by:
      getFormat in interface Key
    • getEncoded

      public byte[] getEncoded()
      Specified by:
      getEncoded in interface Key
    • getPrivateKey

      public OCTET_STRING getPrivateKey()
    • getAttributes

      public SET getAttributes()
      May return null if no attributes are present.
    • getTag

      public Tag getTag()
      Description copied from interface: ASN1Value
      Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
      Specified by:
      getTag in interface ASN1Value
      Returns:
      Base tag.
    • encode

      public void encode(OutputStream ostream) throws IOException
      Description copied from interface: ASN1Value
      Write this value's DER encoding to an output stream using its own base tag.
      Specified by:
      encode in interface ASN1Value
      Parameters:
      ostream - Output stream.
      Throws:
      IOException - If an error occurred.
    • encode

      public void encode(Tag implicitTag, OutputStream ostream) throws IOException
      Description copied from interface: ASN1Value
      Write this value's DER encoding to an output stream using an implicit tag.
      Specified by:
      encode in interface ASN1Value
      Parameters:
      implicitTag - Implicit tag.
      ostream - Output stream.
      Throws:
      IOException - If an error occurred.
    • getTemplate

      public static PrivateKeyInfo.Template getTemplate()