// AddASN1Int64 appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1Int64(v int64) { … } // AddASN1Int64WithTag appends a DER-encoded ASN.1 INTEGER with the // given tag. func (b *Builder) AddASN1Int64WithTag(v int64, tag asn1.Tag) { … } // AddASN1Enum appends a DER-encoded ASN.1 ENUMERATION. func (b *Builder) AddASN1Enum(v int64) { … } func (b *Builder) addASN1Signed(tag asn1.Tag, v int64) { … } // AddASN1Uint64 appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1Uint64(v uint64) { … } // AddASN1BigInt appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1BigInt(n *big.Int) { … } // AddASN1OctetString appends a DER-encoded ASN.1 OCTET STRING. func (b *Builder) AddASN1OctetString(bytes []byte) { … } const generalizedTimeFormatStr … // AddASN1GeneralizedTime appends a DER-encoded ASN.1 GENERALIZEDTIME. func (b *Builder) AddASN1GeneralizedTime(t time.Time) { … } // AddASN1UTCTime appends a DER-encoded ASN.1 UTCTime. func (b *Builder) AddASN1UTCTime(t time.Time) { … } // AddASN1BitString appends a DER-encoded ASN.1 BIT STRING. This does not // support BIT STRINGs that are not a whole number of bytes. func (b *Builder) AddASN1BitString(data []byte) { … } func (b *Builder) addBase128Int(n int64) { … } func isValidOID(oid encoding_asn1.ObjectIdentifier) bool { … } func (b *Builder) AddASN1ObjectIdentifier(oid encoding_asn1.ObjectIdentifier) { … } func (b *Builder) AddASN1Boolean(v bool) { … } func (b *Builder) AddASN1NULL() { … } // MarshalASN1 calls encoding_asn1.Marshal on its input and appends the result if // successful or records an error if one occurred. func (b *Builder) MarshalASN1(v interface{ … } // AddASN1 appends an ASN.1 object. The object is prefixed with the given tag. // Tags greater than 30 are not supported and result in an error (i.e. // low-tag-number form only). The child builder passed to the // BuilderContinuation can be used to build the content of the ASN.1 object. func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) { … } // ReadASN1Boolean decodes an ASN.1 BOOLEAN and converts it to a boolean // representation into out and advances. It reports whether the read // was successful. func (s *String) ReadASN1Boolean(out *bool) bool { … } // ReadASN1Integer decodes an ASN.1 INTEGER into out and advances. If out does // not point to an integer, to a big.Int, or to a []byte it panics. Only // positive and zero values can be decoded into []byte, and they are returned as // big-endian binary values that share memory with s. Positive values will have // no leading zeroes, and zero will be returned as a single zero byte. // ReadASN1Integer reports whether the read was successful. func (s *String) ReadASN1Integer(out interface{ … } func checkASN1Integer(bytes []byte) bool { … } var bigOne … func (s *String) readASN1BigInt(out *big.Int) bool { … } func (s *String) readASN1Bytes(out *[]byte) bool { … } func (s *String) readASN1Int64(out *int64) bool { … } func asn1Signed(out *int64, n []byte) bool { … } func (s *String) readASN1Uint64(out *uint64) bool { … } func asn1Unsigned(out *uint64, n []byte) bool { … } // ReadASN1Int64WithTag decodes an ASN.1 INTEGER with the given tag into out // and advances. It reports whether the read was successful and resulted in a // value that can be represented in an int64. func (s *String) ReadASN1Int64WithTag(out *int64, tag asn1.Tag) bool { … } // ReadASN1Enum decodes an ASN.1 ENUMERATION into out and advances. It reports // whether the read was successful. func (s *String) ReadASN1Enum(out *int) bool { … } func (s *String) readBase128Int(out *int) bool { … } // ReadASN1ObjectIdentifier decodes an ASN.1 OBJECT IDENTIFIER into out and // advances. It reports whether the read was successful. func (s *String) ReadASN1ObjectIdentifier(out *encoding_asn1.ObjectIdentifier) bool { … } // ReadASN1GeneralizedTime decodes an ASN.1 GENERALIZEDTIME into out and // advances. It reports whether the read was successful. func (s *String) ReadASN1GeneralizedTime(out *time.Time) bool { … } const defaultUTCTimeFormatStr … // ReadASN1UTCTime decodes an ASN.1 UTCTime into out and advances. // It reports whether the read was successful. func (s *String) ReadASN1UTCTime(out *time.Time) bool { … } // ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. // It reports whether the read was successful. func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool { … } // ReadASN1BitStringAsBytes decodes an ASN.1 BIT STRING into out and advances. It is // an error if the BIT STRING is not a whole number of bytes. It reports // whether the read was successful. func (s *String) ReadASN1BitStringAsBytes(out *[]byte) bool { … } // ReadASN1Bytes reads the contents of a DER-encoded ASN.1 element (not including // tag and length bytes) into out, and advances. The element must match the // given tag. It reports whether the read was successful. func (s *String) ReadASN1Bytes(out *[]byte, tag asn1.Tag) bool { … } // ReadASN1 reads the contents of a DER-encoded ASN.1 element (not including // tag and length bytes) into out, and advances. The element must match the // given tag. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadASN1(out *String, tag asn1.Tag) bool { … } // ReadASN1Element reads the contents of a DER-encoded ASN.1 element (including // tag and length bytes) into out, and advances. The element must match the // given tag. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadASN1Element(out *String, tag asn1.Tag) bool { … } // ReadAnyASN1 reads the contents of a DER-encoded ASN.1 element (not including // tag and length bytes) into out, sets outTag to its tag, and advances. // It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadAnyASN1(out *String, outTag *asn1.Tag) bool { … } // ReadAnyASN1Element reads the contents of a DER-encoded ASN.1 element // (including tag and length bytes) into out, sets outTag to is tag, and // advances. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadAnyASN1Element(out *String, outTag *asn1.Tag) bool { … } // PeekASN1Tag reports whether the next ASN.1 value on the string starts with // the given tag. func (s String) PeekASN1Tag(tag asn1.Tag) bool { … } // SkipASN1 reads and discards an ASN.1 element with the given tag. It // reports whether the operation was successful. func (s *String) SkipASN1(tag asn1.Tag) bool { … } // ReadOptionalASN1 attempts to read the contents of a DER-encoded ASN.1 // element (not including tag and length bytes) tagged with the given tag into // out. It stores whether an element with the tag was found in outPresent, // unless outPresent is nil. It reports whether the read was successful. func (s *String) ReadOptionalASN1(out *String, outPresent *bool, tag asn1.Tag) bool { … } // SkipOptionalASN1 advances s over an ASN.1 element with the given tag, or // else leaves s unchanged. It reports whether the operation was successful. func (s *String) SkipOptionalASN1(tag asn1.Tag) bool { … } // ReadOptionalASN1Integer attempts to read an optional ASN.1 INTEGER explicitly // tagged with tag into out and advances. If no element with a matching tag is // present, it writes defaultValue into out instead. Otherwise, it behaves like // ReadASN1Integer. func (s *String) ReadOptionalASN1Integer(out interface{ … } // ReadOptionalASN1OctetString attempts to read an optional ASN.1 OCTET STRING // explicitly tagged with tag into out and advances. If no element with a // matching tag is present, it sets "out" to nil instead. It reports // whether the read was successful. func (s *String) ReadOptionalASN1OctetString(out *[]byte, outPresent *bool, tag asn1.Tag) bool { … } // ReadOptionalASN1Boolean attempts to read an optional ASN.1 BOOLEAN // explicitly tagged with tag into out and advances. If no element with a // matching tag is present, it sets "out" to defaultValue instead. It reports // whether the read was successful. func (s *String) ReadOptionalASN1Boolean(out *bool, tag asn1.Tag, defaultValue bool) bool { … } func (s *String) readASN1(out *String, outTag *asn1.Tag, skipHeader bool) bool { … }