scrm-go

parse.go 664B

1234567891011121314151617181920212223242526272829303132
  1. package tencentsig
  2. import (
  3. "crypto/x509/pkix"
  4. "encoding/asn1"
  5. )
  6. var (
  7. oidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1}
  8. oidNamedCurveS256 = asn1.ObjectIdentifier{1, 3, 132, 0, 10}
  9. )
  10. type pkcs8 struct {
  11. Version int
  12. Algo pkix.AlgorithmIdentifier
  13. PrivateKey []byte
  14. // optional attributes omitted.
  15. }
  16. type publicKeyInfo struct {
  17. Raw asn1.RawContent
  18. Algorithm pkix.AlgorithmIdentifier
  19. PublicKey asn1.BitString
  20. }
  21. type ecPrivateKey struct {
  22. Version int
  23. PrivateKey []byte
  24. NamedCurveOID asn1.ObjectIdentifier `asn1:"optional,explicit,tag:0"`
  25. PublicKey asn1.BitString `asn1:"optional,explicit,tag:1"`
  26. }