code: func ecPub(
  	ctx pkcs11helpers.PKCtx,
  	session pkcs11.SessionHandle,
  	object pkcs11.ObjectHandle,
  	expectedCurve *elliptic.CurveParams,
  ) (*ecdsa.PublicKey, error) {
  	pubKey, err := pkcs11helpers.GetECDSAPublicKey(ctx, session, object)
  	if err != nil {
  		return nil, err
  	}
  	if pubKey.Curve != expectedCurve {
  		return nil, errors.New("Returned EC parameters doesn't match expected curve")
  	}
  	log.Printf("\tX: %X\n", pubKey.X.Bytes())
  	log.Printf("\tY: %X\n", pubKey.Y.Bytes())
  	return pubKey, nil
  }
docs: // ecPub extracts the generated public key, specified by the provided object
  // handle, and constructs an ecdsa.PublicKey. It also checks that the key is of
  // the correct curve type.