Documentation
¶
Overview ¶
Package sm9 handle shangmi sm9 algorithm and its curves and pairing implementation
Index ¶
- Constants
- Variables
- func Decrypt(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)
- func DecryptASN1(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)
- func Encrypt(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, ...) ([]byte, error)
- func EncryptASN1(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, ...) ([]byte, error)
- func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)
- func Marshal(curve Curve, x, y *big.Int) []byte
- func MarshalCompressed(curve Curve, x, y *big.Int) []byte
- func NewCurveGenerator() *curvePoint
- func NewCurvePoint() *curvePoint
- func NewTwistGenerator() *twistPoint
- func NewTwistPoint() *twistPoint
- func SignASN1(rand io.Reader, priv *SignPrivateKey, hash []byte) ([]byte, error)
- func Unmarshal(curve Curve, data []byte) (x, y *big.Int)
- func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int)
- func UnwrappKey(priv *EncryptPrivateKey, uid []byte, cipher *G1, kLen int) ([]byte, error)
- func Verify(pub *SignMasterPublicKey, uid []byte, hid byte, hash []byte, h *big.Int, s *G1) bool
- func VerifyASN1(pub *SignMasterPublicKey, uid []byte, hid byte, hash, sig []byte) bool
- type Curve
- type CurveParams
- func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool
- func (curve *CurveParams) Params() *CurveParams
- func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type EncryptMasterPrivateKey
- func (master *EncryptMasterPrivateKey) GenerateUserKey(uid []byte, hid byte) (*EncryptPrivateKey, error)
- func (master *EncryptMasterPrivateKey) MarshalASN1() ([]byte, error)
- func (master *EncryptMasterPrivateKey) Public() *EncryptMasterPublicKey
- func (master *EncryptMasterPrivateKey) UnmarshalASN1(der []byte) error
- type EncryptMasterPublicKey
- func (pub *EncryptMasterPublicKey) Encrypt(rand io.Reader, uid []byte, hid byte, plaintext []byte) ([]byte, error)
- func (pub *EncryptMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G1
- func (pub *EncryptMasterPublicKey) MarshalASN1() ([]byte, error)
- func (pub *EncryptMasterPublicKey) Pair() *GT
- func (pub *EncryptMasterPublicKey) ScalarBaseMult(r *big.Int) *GT
- func (pub *EncryptMasterPublicKey) UnmarshalASN1(der []byte) error
- func (pub *EncryptMasterPublicKey) WrappKey(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, []byte, error)
- func (pub *EncryptMasterPublicKey) WrappKeyASN1(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, error)
- type EncryptPrivateKey
- func (priv *EncryptPrivateKey) MarshalASN1() ([]byte, error)
- func (priv *EncryptPrivateKey) MasterPublic() *EncryptMasterPublicKey
- func (priv *EncryptPrivateKey) SetMasterPublicKey(pub *EncryptMasterPublicKey)
- func (priv *EncryptPrivateKey) UnmarshalASN1(der []byte) error
- func (priv *EncryptPrivateKey) UnwrappKey(uid, cipherDer []byte, kLen int) ([]byte, error)
- type G1
- func RandomG1(r io.Reader) (*big.Int, *G1, error)
- func Sign(rand io.Reader, priv *SignPrivateKey, hash []byte) (h *big.Int, s *G1, err error)
- func UnmarshalSM9KeyPackage(der []byte) ([]byte, *G1, error)
- func WrappKey(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, kLen int) (key []byte, cipher *G1, err error)
- func (e *G1) Add(a, b *G1) *G1
- func (e *G1) Double(a *G1) *G1
- func (e *G1) Marshal() []byte
- func (e *G1) MarshalUncompressed() []byte
- func (e *G1) Neg(a *G1) *G1
- func (e *G1) ScalarBaseMult(k *big.Int) *G1
- func (e *G1) ScalarMult(a *G1, k *big.Int) *G1
- func (e *G1) Set(a *G1) *G1
- func (g *G1) String() string
- func (e *G1) Unmarshal(m []byte) ([]byte, error)
- type G1Curve
- func (g1 *G1Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (g1 *G1Curve) Double(x, y *big.Int) (*big.Int, *big.Int)
- func (g1 *G1Curve) IsOnCurve(x, y *big.Int) bool
- func (g1 *G1Curve) Params() *CurveParams
- func (g1 *G1Curve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (g1 *G1Curve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- func (curve *G1Curve) Unmarshal(data []byte) (x, y *big.Int)
- func (curve *G1Curve) UnmarshalCompressed(data []byte) (x, y *big.Int)
- type G2
- func (e *G2) Add(a, b *G2) *G2
- func (e *G2) Marshal() []byte
- func (e *G2) MarshalUncompressed() []byte
- func (e *G2) Neg(a *G2) *G2
- func (e *G2) ScalarBaseMult(k *big.Int) *G2
- func (e *G2) ScalarMult(a *G2, k *big.Int) *G2
- func (e *G2) Set(a *G2) *G2
- func (e *G2) String() string
- func (e *G2) Unmarshal(m []byte) ([]byte, error)
- type GT
- func (e *GT) Add(a, b *GT) *GT
- func (e *GT) Finalize() *GT
- func (e *GT) Marshal() []byte
- func (e *GT) Neg(a *GT) *GT
- func (e *GT) ScalarBaseMult(k *big.Int) *GT
- func (e *GT) ScalarMult(a *GT, k *big.Int) *GT
- func (e *GT) Set(a *GT) *GT
- func (e *GT) SetOne() *GT
- func (g *GT) String() string
- func (e *GT) Unmarshal(m []byte) ([]byte, error)
- type SignMasterPrivateKey
- type SignMasterPublicKey
- func (pub *SignMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G2
- func (pub *SignMasterPublicKey) MarshalASN1() ([]byte, error)
- func (pub *SignMasterPublicKey) Pair() *GT
- func (pub *SignMasterPublicKey) ScalarBaseMult(r *big.Int) *GT
- func (pub *SignMasterPublicKey) UnmarshalASN1(der []byte) error
- func (pub *SignMasterPublicKey) Verify(uid []byte, hid byte, hash, sig []byte) bool
- type SignPrivateKey
- func (priv *SignPrivateKey) MarshalASN1() ([]byte, error)
- func (priv *SignPrivateKey) MasterPublic() *SignMasterPublicKey
- func (priv *SignPrivateKey) SetMasterPublicKey(pub *SignMasterPublicKey)
- func (priv *SignPrivateKey) Sign(rand io.Reader, hash []byte, opts crypto.SignerOpts) ([]byte, error)
- func (priv *SignPrivateKey) UnmarshalASN1(der []byte) error
Constants ¶
const ( // hashmode used in h1: 0x01 H1 hashMode = 1 + iota // hashmode used in h2: 0x02 H2 )
const ( ENC_TYPE_XOR encryptType = 0 ENC_TYPE_ECB encryptType = 1 ENC_TYPE_CBC encryptType = 2 ENC_TYPE_OFB encryptType = 4 ENC_TYPE_CFB encryptType = 8 )
Variables ¶
var Gen1 = &G1{curveGen}
Gen1 is the generator of G1.
var Gen2 = &G2{twistGen}
Gen2 is the generator of G2.
var Order = bigFromHex("b640000002a3a6f1d603ab4ff58ec74449f2934b18ea8beee56ee19cd69ecf25")
Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u²+6u+1.
Functions ¶
func Decrypt ¶ added in v0.13.0
func Decrypt(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)
Decrypt decrypt chipher, ciphertext should be with format C1||C3||C2
func DecryptASN1 ¶ added in v0.13.0
func DecryptASN1(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)
DecryptASN1 decrypt chipher, ciphertext should be with ASN.1 format according SM9 cryptographic algorithm application specification
func Encrypt ¶ added in v0.13.0
func Encrypt(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, plaintext []byte) ([]byte, error)
Encrypt encrypt plaintext, output ciphertext with format C1||C3||C2
func EncryptASN1 ¶ added in v0.13.0
func EncryptASN1(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, plaintext []byte) ([]byte, error)
EncryptASN1 encrypt plaintext and output ciphertext with ASN.1 format according SM9 cryptographic algorithm application specification
func GenerateKey ¶
GenerateKey returns a public/private key pair. The private key is generated using the given reader, which must return random data.
func Marshal ¶
Marshal converts a point on the curve into the uncompressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined.
func MarshalCompressed ¶
MarshalCompressed converts a point on the curve into the compressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined.
func NewCurveGenerator ¶ added in v0.13.0
func NewCurveGenerator() *curvePoint
func NewCurvePoint ¶ added in v0.13.0
func NewCurvePoint() *curvePoint
func NewTwistGenerator ¶ added in v0.13.0
func NewTwistGenerator() *twistPoint
func NewTwistPoint ¶ added in v0.13.0
func NewTwistPoint() *twistPoint
func SignASN1 ¶ added in v0.13.0
SignASN1 signs a hash (which should be the result of hashing a larger message) using the private key, priv. It returns the ASN.1 encoded signature.
func Unmarshal ¶
Unmarshal converts a point, serialized by Marshal, into an x, y pair. It is an error if the point is not in uncompressed form, is not on the curve, or is the point at infinity. On error, x = nil.
func UnmarshalCompressed ¶
UnmarshalCompressed converts a point, serialized by MarshalCompressed, into an x, y pair. It is an error if the point is not in compressed form, is not on the curve, or is the point at infinity. On error, x = nil.
func UnwrappKey ¶ added in v0.13.0
UnwrappKey unwrapper key from cipher, user id and aligned key length
func Verify ¶ added in v0.13.0
Verify verifies the signature in h, s of hash using the master dsa public key and user id, uid and hid. Its return value records whether the signature is valid.
func VerifyASN1 ¶ added in v0.13.0
func VerifyASN1(pub *SignMasterPublicKey, uid []byte, hid byte, hash, sig []byte) bool
VerifyASN1 verifies the ASN.1 encoded signature, sig, of hash using the public key, pub. Its return value records whether the signature is valid.
Types ¶
type Curve ¶
type Curve interface { // Params returns the parameters for the curve. Params() *CurveParams // IsOnCurve reports whether the given (x,y) lies on the curve. IsOnCurve(x, y *big.Int) bool // Add returns the sum of (x1,y1) and (x2,y2) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) // Double returns 2*(x,y) Double(x1, y1 *big.Int) (x, y *big.Int) // ScalarMult returns k*(Bx,By) where k is a number in big-endian form. ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int) // ScalarBaseMult returns k*G, where G is the base point of the group // and k is an integer in big-endian form. ScalarBaseMult(k []byte) (x, y *big.Int) }
A Curve represents a short-form Weierstrass curve with a=0.
The behavior of Add, Double, and ScalarMult when the input is not a point on the curve is undefined.
Note that the conventional point at infinity (0, 0) is not considered on the curve, although it can be returned by Add, Double, ScalarMult, or ScalarBaseMult (but not the Unmarshal or UnmarshalCompressed functions).
type CurveParams ¶
type CurveParams struct { P *big.Int // the order of the underlying field N *big.Int // the order of the base point B *big.Int // the constant of the curve equation Gx, Gy *big.Int // (x,y) of the base point BitSize int // the size of the underlying field Name string // the canonical name of the curve }
CurveParams contains the parameters of an elliptic curve and also provides a generic, non-constant time implementation of Curve.
func (*CurveParams) Params ¶
func (curve *CurveParams) Params() *CurveParams
func (*CurveParams) ScalarBaseMult ¶
func (*CurveParams) ScalarMult ¶
type EncryptMasterPrivateKey ¶ added in v0.13.0
type EncryptMasterPrivateKey struct { EncryptMasterPublicKey D *big.Int }
func GenerateEncryptMasterKey ¶ added in v0.13.0
func GenerateEncryptMasterKey(rand io.Reader) (*EncryptMasterPrivateKey, error)
GenerateEncryptMasterKey generates a master public and private key pair for encryption usage.
func (*EncryptMasterPrivateKey) GenerateUserKey ¶ added in v0.13.0
func (master *EncryptMasterPrivateKey) GenerateUserKey(uid []byte, hid byte) (*EncryptPrivateKey, error)
GenerateUserKey generate an user key for encryption.
func (*EncryptMasterPrivateKey) MarshalASN1 ¶ added in v0.13.0
func (master *EncryptMasterPrivateKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal encrypt master private key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*EncryptMasterPrivateKey) Public ¶ added in v0.13.0
func (master *EncryptMasterPrivateKey) Public() *EncryptMasterPublicKey
Public returns the public key corresponding to priv.
func (*EncryptMasterPrivateKey) UnmarshalASN1 ¶ added in v0.13.0
func (master *EncryptMasterPrivateKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to encrpt master private key
type EncryptMasterPublicKey ¶ added in v0.13.0
type EncryptMasterPublicKey struct { MasterPublicKey *G1 // contains filtered or unexported fields }
func (*EncryptMasterPublicKey) Encrypt ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) Encrypt(rand io.Reader, uid []byte, hid byte, plaintext []byte) ([]byte, error)
Encrypt encrypt plaintext and output ciphertext with ASN.1 format according SM9 cryptographic algorithm application specification
func (*EncryptMasterPublicKey) GenerateUserPublicKey ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G1
GenerateUserPublicKey generate user encrypt public key
func (*EncryptMasterPublicKey) MarshalASN1 ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal encrypt master public key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*EncryptMasterPublicKey) Pair ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) Pair() *GT
func (*EncryptMasterPublicKey) ScalarBaseMult ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) ScalarBaseMult(r *big.Int) *GT
func (*EncryptMasterPublicKey) UnmarshalASN1 ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to encrypt master public key
func (*EncryptMasterPublicKey) WrappKey ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) WrappKey(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, []byte, error)
WrappKey wrapp key and marshal the cipher as ASN1 format.
func (*EncryptMasterPublicKey) WrappKeyASN1 ¶ added in v0.13.0
func (pub *EncryptMasterPublicKey) WrappKeyASN1(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, error)
WrappKey wrapp key and marshal the result of SM9KeyPackage as ASN1 format. according SM9 cryptographic algorithm application specification
type EncryptPrivateKey ¶ added in v0.13.0
type EncryptPrivateKey struct { PrivateKey *G2 EncryptMasterPublicKey }
func (*EncryptPrivateKey) MarshalASN1 ¶ added in v0.13.0
func (priv *EncryptPrivateKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal encrypt user private key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*EncryptPrivateKey) MasterPublic ¶ added in v0.13.0
func (priv *EncryptPrivateKey) MasterPublic() *EncryptMasterPublicKey
MasterPublic returns the master public key corresponding to priv.
func (*EncryptPrivateKey) SetMasterPublicKey ¶ added in v0.13.0
func (priv *EncryptPrivateKey) SetMasterPublicKey(pub *EncryptMasterPublicKey)
SetMasterPublicKey bind the encrypt master public key to it.
func (*EncryptPrivateKey) UnmarshalASN1 ¶ added in v0.13.0
func (priv *EncryptPrivateKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to encrypt user private key Note, priv's EncryptMasterPublicKey should be handled separately.
func (*EncryptPrivateKey) UnwrappKey ¶ added in v0.13.0
func (priv *EncryptPrivateKey) UnwrappKey(uid, cipherDer []byte, kLen int) ([]byte, error)
type G1 ¶
type G1 struct {
// contains filtered or unexported fields
}
G1 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
func Sign ¶ added in v0.13.0
Sign signs a hash (which should be the result of hashing a larger message) using the user dsa key. It returns the signature as a pair of h and s.
func UnmarshalSM9KeyPackage ¶ added in v0.13.0
UnmarshalSM9KeyPackage is an utility to unmarshal SM9KeyPackage
func WrappKey ¶ added in v0.13.0
func WrappKey(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, kLen int) (key []byte, cipher *G1, err error)
WrappKey generate and wrapp key wtih reciever's uid and system hid
func (*G1) MarshalUncompressed ¶ added in v0.13.0
Marshal converts e to a byte slice with prefix
func (*G1) ScalarBaseMult ¶
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns e.
func (*G1) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.
type G1Curve ¶
type G1Curve struct {
// contains filtered or unexported fields
}
func (*G1Curve) Params ¶
func (g1 *G1Curve) Params() *CurveParams
func (*G1Curve) ScalarMult ¶
type G2 ¶
type G2 struct {
// contains filtered or unexported fields
}
G2 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
func (*G2) MarshalUncompressed ¶ added in v0.13.0
Marshal converts e into a byte slice with prefix
func (*G2) ScalarBaseMult ¶
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.
func (*G2) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.
type GT ¶
type GT struct {
// contains filtered or unexported fields
}
GT is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
func Miller ¶
Miller applies Miller's algorithm, which is a bilinear function from the source groups to F_p^12. Miller(g1, g2).Finalize() is equivalent to Pair(g1, g2).
func (*GT) ScalarBaseMult ¶
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.
func (*GT) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.
type SignMasterPrivateKey ¶ added in v0.13.0
type SignMasterPrivateKey struct { SignMasterPublicKey D *big.Int }
func GenerateSignMasterKey ¶ added in v0.13.0
func GenerateSignMasterKey(rand io.Reader) (*SignMasterPrivateKey, error)
GenerateSignMasterKey generates a master public and private key pair for DSA usage.
func (*SignMasterPrivateKey) GenerateUserKey ¶ added in v0.13.0
func (master *SignMasterPrivateKey) GenerateUserKey(uid []byte, hid byte) (*SignPrivateKey, error)
GenerateUserKey generate an user dsa key.
func (*SignMasterPrivateKey) MarshalASN1 ¶ added in v0.13.0
func (master *SignMasterPrivateKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal sign master private key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*SignMasterPrivateKey) Public ¶ added in v0.13.0
func (master *SignMasterPrivateKey) Public() *SignMasterPublicKey
Public returns the public key corresponding to priv.
func (*SignMasterPrivateKey) UnmarshalASN1 ¶ added in v0.13.0
func (master *SignMasterPrivateKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to sign master private key
type SignMasterPublicKey ¶ added in v0.13.0
type SignMasterPublicKey struct { MasterPublicKey *G2 // contains filtered or unexported fields }
func (*SignMasterPublicKey) GenerateUserPublicKey ¶ added in v0.13.0
func (pub *SignMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G2
GenerateUserPublicKey generate user sign public key
func (*SignMasterPublicKey) MarshalASN1 ¶ added in v0.13.0
func (pub *SignMasterPublicKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal sign master public key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*SignMasterPublicKey) Pair ¶ added in v0.13.0
func (pub *SignMasterPublicKey) Pair() *GT
func (*SignMasterPublicKey) ScalarBaseMult ¶ added in v0.13.0
func (pub *SignMasterPublicKey) ScalarBaseMult(r *big.Int) *GT
func (*SignMasterPublicKey) UnmarshalASN1 ¶ added in v0.13.0
func (pub *SignMasterPublicKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to sign master public key
type SignPrivateKey ¶ added in v0.13.0
type SignPrivateKey struct { PrivateKey *G1 SignMasterPublicKey }
func (*SignPrivateKey) MarshalASN1 ¶ added in v0.13.0
func (priv *SignPrivateKey) MarshalASN1() ([]byte, error)
MarshalASN1 marshal sign user private key to asn.1 format data according SM9 cryptographic algorithm application specification
func (*SignPrivateKey) MasterPublic ¶ added in v0.13.0
func (priv *SignPrivateKey) MasterPublic() *SignMasterPublicKey
MasterPublic returns the master public key corresponding to priv.
func (*SignPrivateKey) SetMasterPublicKey ¶ added in v0.13.0
func (priv *SignPrivateKey) SetMasterPublicKey(pub *SignMasterPublicKey)
SetMasterPublicKey bind the sign master public key to it.
func (*SignPrivateKey) Sign ¶ added in v0.13.0
func (priv *SignPrivateKey) Sign(rand io.Reader, hash []byte, opts crypto.SignerOpts) ([]byte, error)
Sign signs digest with user's DSA key, reading randomness from rand. The opts argument is not currently used but, in keeping with the crypto.Signer interface.
func (*SignPrivateKey) UnmarshalASN1 ¶ added in v0.13.0
func (priv *SignPrivateKey) UnmarshalASN1(der []byte) error
UnmarshalASN1 unmarsal der data to sign user private key Note, priv's SignMasterPublicKey should be handled separately.