func (u *UseExtendedMasterSecret) Unmarshal(data []byte) error {
	if len(data) < useExtendedMasterSecretHeaderSize {
		return errBufferTooSmall
	} else if TypeValue(binary.BigEndian.Uint16(data)) != u.TypeValue() {
		return errInvalidExtensionType
	}
	u.Supported = true
	return nil
}
Unmarshal populates the extension from encoded data
package extension
import "encoding/binary"
const (
	useExtendedMasterSecretHeaderSize = 4
)
type UseExtendedMasterSecret struct {
	Supported bool
}
func (u UseExtendedMasterSecret) TypeValue() TypeValue {
	return UseExtendedMasterSecretTypeValue
}
func (u *UseExtendedMasterSecret) Marshal() ([]byte, error) {
	if !u.Supported {
		return []byte{}, nil
	}
	out := make([]byte, useExtendedMasterSecretHeaderSize)
	binary.BigEndian.PutUint16(out, uint16(u.TypeValue()))
	binary.BigEndian.PutUint16(out[2:], uint16(0))  
	return out, nil
}