func TestOzone314SignatureString(t *testing.T) {
	signingMethod := jwt.SigningMethodPS256.SigningMethodRSA

	segments := strings.Split(OzoneTestSignature, ".")
	segments[1] = jwt.EncodeSegment([]byte(OzoneResponseBody))
	logrus.Printf(strings.Join(segments, "."))

	pubkey, err := LoadRSAPublicKeyFromDisk("../../../certs/waiver007/DKePOLAOiXLwYhMfLS8aS6YU-d0.pem")
	if err != nil {
		fmt.Println("WARNING - keyfile not found")
		return
	}

	modulus := pubkey.N.Bytes()
	modulusBase64 := base64.RawURLEncoding.EncodeToString(modulus)
	kid, err := authentication.CalcKid(modulusBase64)
	logrus.Infof("kid: " + kid)
	err = signingMethod.Verify(strings.Join(segments[:2], "."), segments[2], pubkey)
	logrus.Error(err)
}
// Test using ozone server certificate
Test using ozone server certificate
// Test using ozone server certificate
func TestOzone314SignatureString(t *testing.T) {
	signingMethod := jwt.SigningMethodPS256.SigningMethodRSA
	segments := strings.Split(OzoneTestSignature, ".")
	segments[1] = jwt.EncodeSegment([]byte(OzoneResponseBody))
	logrus.Printf(strings.Join(segments, "."))
	pubkey, err := LoadRSAPublicKeyFromDisk("../../../certs/waiver007/DKePOLAOiXLwYhMfLS8aS6YU-d0.pem")
	if err != nil {
		fmt.Println("WARNING - keyfile not found")
		return
	}
	modulus := pubkey.N.Bytes()
	modulusBase64 := base64.RawURLEncoding.EncodeToString(modulus)
	kid, err := authentication.CalcKid(modulusBase64)
	logrus.Infof("kid: " + kid)
	err = signingMethod.Verify(strings.Join(segments[:2], "."), segments[2], pubkey)
	logrus.Error(err)
}
func TestOzone314SignatureString ( t * testing . T ) { signingMethod := jwt . SigningMethodPS256 . SigningMethodRSA segments := strings . Split ( OzoneTestSignature , " " ) segments [ 1 ] = jwt . EncodeSegment ( [ ] byte ( OzoneResponseBody ) ) logrus . Printf ( strings . Join ( segments , " " ) ) pubkey , err := LoadRSAPublicKeyFromDisk ( " " ) if err != nil { fmt . Println ( " " ) return } modulus := pubkey . N . Bytes ( ) modulusBase64 := base64 . RawURLEncoding . EncodeToString ( modulus ) kid , err := authentication . CalcKid ( modulusBase64 ) logrus . Infof ( " " + kid ) err = signingMethod . Verify ( strings . Join ( segments [ : 2 ] , " " ) , segments [ 2 ] , pubkey ) logrus . Error ( err ) }
Test using ozone server certificate
Test using ozone server certificate