func TestSimpleb64falseSignature(t *testing.T) {
	ctx.PutStringSlice("apiversions", []string{"payments_v3.1.3"})
	ctx.PutString("tpp_signature_kid", "x")
	ctx.PutString("tpp_signature_issuer", "x/x")
	ctx.PutString("tpp_signature_tan", "openbanking.org.uk")
	cert, _ := authentication.SigningCertFromContext(ctx)
	pubKey := cert.PublicKey()
	_ = pubKey
	i := Input{JwsSig: true, Method: "POST", Endpoint: "https://google.com", RequestBody: "$domestic_payment_template"}
	tc := TestCase{Input: i}
	req, err := tc.Prepare(&ctx)
	assert.Nil(t, err)
	sig := req.Header.Get("x-jws-signature")
	assert.NotEmpty(t, sig)
	logrus.Infoln(sig)
	validatedOK, err := validateSignatureTest(sig, domesticPayBody, authentication.SigningMethodPS256, pubKey)
	assert.True(t, validatedOK)
}
// Create and validate b64=false signature
Create and validate b64=false signature
// Create and validate b64 = false signature
func TestSimpleb64falseSignature(t *testing.T) {
	ctx.PutStringSlice("apiversions", []string{"payments_v3.1.3"})
	ctx.PutString("tpp_signature_kid", "x")
	ctx.PutString("tpp_signature_issuer", "x/x")
	ctx.PutString("tpp_signature_tan", "openbanking.org.uk")
	cert, _ := authentication.SigningCertFromContext(ctx)
	pubKey := cert.PublicKey()
	_ = pubKey
	i := Input{JwsSig: true, Method: "POST", Endpoint: "https://google.com", RequestBody: "$domestic_payment_template"}
	tc := TestCase{Input: i}
	req, err := tc.Prepare(&ctx)
	assert.Nil(t, err)
	sig := req.Header.Get("x-jws-signature")
	assert.NotEmpty(t, sig)
	logrus.Infoln(sig)
	validatedOK, err := validateSignatureTest(sig, domesticPayBody, authentication.SigningMethodPS256, pubKey)
	assert.True(t, validatedOK)
}
func TestSimpleb64falseSignature ( t * testing . T ) { ctx . PutStringSlice ( " " , [ ] string { " " } ) ctx . PutString ( " " , " " ) ctx . PutString ( " " , " " ) ctx . PutString ( " " , " " ) cert , _ := authentication . SigningCertFromContext ( ctx ) pubKey := cert . PublicKey ( ) _ = pubKey i := Input { JwsSig : true , Method : " " , Endpoint : " " , RequestBody : " " } tc := TestCase { Input : i } req , err := tc . Prepare ( & ctx ) assert . Nil ( t , err ) sig := req . Header . Get ( " " ) assert . NotEmpty ( t , sig ) logrus . Infoln ( sig ) validatedOK , err := validateSignatureTest ( sig , domesticPayBody , authentication . SigningMethodPS256 , pubKey ) assert . True ( t , validatedOK ) }
Create and validate b64=false signature
Create and validate b64 = false signature