func (key ECDSAPublicKey) Marshal() ([]byte, error) {
	var curve Curve
	switch key.key.Curve {
	case elliptic.P256():
		curve = CurveP256
	case elliptic.P384():
		curve = CurveP384
	case elliptic.P521():
		curve = CurveP521
	default:
		return nil, fmt.Errorf("%w: %v", ErrUnsupportedCurve, key.key.Curve)
	}

	obj := publicKeyStructureEC2{
		Type:        key.Type(),
		Algorithm:   key.Algorithm(),
		Curve:       curve,
		XCoordinate: key.key.X.Bytes(),
		YCoordinate: key.key.Y.Bytes(),
	}
	return cbor.Marshal(obj)
}
// Marshal marshals the key.
Marshal marshals the key.
// Marshal marshals the key .
func (key ECDSAPublicKey) Marshal() ([]byte, error) {
	var curve Curve
	switch key.key.Curve {
	case elliptic.P256():
		curve = CurveP256
	case elliptic.P384():
		curve = CurveP384
	case elliptic.P521():
		curve = CurveP521
	default:
		return nil, fmt.Errorf("%w: %v", ErrUnsupportedCurve, key.key.Curve)
	}
	obj := publicKeyStructureEC2{
		Type:        key.Type(),
		Algorithm:   key.Algorithm(),
		Curve:       curve,
		XCoordinate: key.key.X.Bytes(),
		YCoordinate: key.key.Y.Bytes(),
	}
	return cbor.Marshal(obj)
}
func ( key ECDSAPublicKey ) Marshal ( ) ( [ ] byte , error ) { var curve Curve switch key . key . Curve { case elliptic . P256 ( ) : curve = CurveP256 case elliptic . P384 ( ) : curve = CurveP384 case elliptic . P521 ( ) : curve = CurveP521 default : return nil , fmt . Errorf ( " " , ErrUnsupportedCurve , key . key . Curve ) } obj := publicKeyStructureEC2 { Type : key . Type ( ) , Algorithm : key . Algorithm ( ) , Curve : curve , XCoordinate : key . key . X . Bytes ( ) , YCoordinate : key . key . Y . Bytes ( ) , } return cbor . Marshal ( obj ) }
Marshal marshals the key.
Marshal marshals the key .