mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 02:06:18 +08:00
34 lines
773 B
Go
34 lines
773 B
Go
![]() |
package smx509
|
||
|
|
||
|
import "math/big"
|
||
|
|
||
|
// pkcs1PrivateKey is a structure which mirrors the PKCS #1 ASN.1 for an RSA private key.
|
||
|
type pkcs1PrivateKey struct {
|
||
|
Version int
|
||
|
N *big.Int
|
||
|
E int
|
||
|
D *big.Int
|
||
|
P *big.Int
|
||
|
Q *big.Int
|
||
|
// We ignore these values, if present, because rsa will calculate them.
|
||
|
Dp *big.Int `asn1:"optional"`
|
||
|
Dq *big.Int `asn1:"optional"`
|
||
|
Qinv *big.Int `asn1:"optional"`
|
||
|
|
||
|
AdditionalPrimes []pkcs1AdditionalRSAPrime `asn1:"optional,omitempty"`
|
||
|
}
|
||
|
|
||
|
type pkcs1AdditionalRSAPrime struct {
|
||
|
Prime *big.Int
|
||
|
|
||
|
// We ignore these values because rsa will calculate them.
|
||
|
Exp *big.Int
|
||
|
Coeff *big.Int
|
||
|
}
|
||
|
|
||
|
// pkcs1PublicKey reflects the ASN.1 structure of a PKCS #1 public key.
|
||
|
type pkcs1PublicKey struct {
|
||
|
N *big.Int
|
||
|
E int
|
||
|
}
|