TypedData.go 558 B

123456789101112131415161718
  1. package types
  2. import "github.com/jcmturner/gofork/encoding/asn1"
  3. // TypedData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1
  4. type TypedData struct {
  5. DataType int32 `asn1:"explicit,tag:0"`
  6. DataValue []byte `asn1:"optional,explicit,tag:1"`
  7. }
  8. // TypedDataSequence implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1
  9. type TypedDataSequence []TypedData
  10. // Unmarshal bytes into the TypedDataSequence.
  11. func (a *TypedDataSequence) Unmarshal(b []byte) error {
  12. _, err := asn1.Unmarshal(b, a)
  13. return err
  14. }