Class SM2Cipher

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.ofdrw.gm.sm2strut.SM2Cipher
All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable, org.bouncycastle.util.Encodable

public class SM2Cipher extends org.bouncycastle.asn1.ASN1Object
GBT 35276-2017 7.2 加密数据格式
Since:
2021-07-29 20:08:03
Author:
权观宇
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    SM2Cipher(org.bouncycastle.asn1.ASN1Sequence seq)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Convert ASN.1 Struct to C1C3C2 format
    static SM2Cipher
    fromC1C3C2(byte[] c1c3c2)
    Convert SM2 encrypted result format of c1c3c2 to ASN.1 SM2Cipher
    org.bouncycastle.asn1.ASN1OctetString
     
    org.bouncycastle.asn1.ASN1OctetString
     
    static SM2Cipher
     
    org.bouncycastle.asn1.ASN1Integer
     
    org.bouncycastle.asn1.ASN1Integer
     
    void
    setCipherText(org.bouncycastle.asn1.ASN1OctetString cipherText)
     
    void
    setHash(org.bouncycastle.asn1.ASN1OctetString hash)
     
    void
    setxCoordinate(org.bouncycastle.asn1.ASN1Integer xCoordinate)
     
    void
    setyCoordinate(org.bouncycastle.asn1.ASN1Integer yCoordinate)
     
    org.bouncycastle.asn1.ASN1Primitive
     

    Methods inherited from class org.bouncycastle.asn1.ASN1Object

    encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SM2Cipher

      public SM2Cipher()
    • SM2Cipher

      public SM2Cipher(org.bouncycastle.asn1.ASN1Sequence seq)
  • Method Details

    • getInstance

      public static SM2Cipher getInstance(Object o)
    • getxCoordinate

      public org.bouncycastle.asn1.ASN1Integer getxCoordinate()
    • setxCoordinate

      public void setxCoordinate(org.bouncycastle.asn1.ASN1Integer xCoordinate)
    • getyCoordinate

      public org.bouncycastle.asn1.ASN1Integer getyCoordinate()
    • setyCoordinate

      public void setyCoordinate(org.bouncycastle.asn1.ASN1Integer yCoordinate)
    • getHash

      public org.bouncycastle.asn1.ASN1OctetString getHash()
    • setHash

      public void setHash(org.bouncycastle.asn1.ASN1OctetString hash)
    • getCipherText

      public org.bouncycastle.asn1.ASN1OctetString getCipherText()
    • setCipherText

      public void setCipherText(org.bouncycastle.asn1.ASN1OctetString cipherText)
    • toASN1Primitive

      public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()
      Specified by:
      toASN1Primitive in interface org.bouncycastle.asn1.ASN1Encodable
      Specified by:
      toASN1Primitive in class org.bouncycastle.asn1.ASN1Object
    • convertC1C3C2

      public byte[] convertC1C3C2() throws IOException
      Convert ASN.1 Struct to C1C3C2 format
      Returns:
      C1C3C2
      Throws:
      IOException - IO操作异常
    • fromC1C3C2

      public static SM2Cipher fromC1C3C2(byte[] c1c3c2) throws IOException
      Convert SM2 encrypted result format of c1c3c2 to ASN.1 SM2Cipher
      Parameters:
      c1c3c2 - encrypted result
      Returns:
      SM2Cipher
      Throws:
      IOException - IO操作异常