Encode returns the wire-format bytes of this extension field, padded per RFC 7822.
()
| 128 | func (ef ExtensionField) EncodedSize() int { |
| 129 | total := padTo(ExtensionHeaderSize+len(ef.Body), ExtensionAlignment) |
| 130 | return max(total, ExtensionMinSize) |
| 131 | } |
| 132 | |
| 133 | // Encode returns the wire-format bytes of this extension field, padded per RFC 7822. |
| 134 | func (ef ExtensionField) Encode() ([]byte, error) { |
| 135 | return MarshalExtensionFields([]ExtensionField{ef}) |