func TestESAlgorithms(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	assert.Nil(err)
	claims := initClaims()
	for _, test := range esTests {
		assert.Logf("testing algorithm %q", test)
		// Encode.
		jwtEncode, err := jwt.Encode(claims, privateKey, test)
		assert.Nil(err)
		parts := strings.Split(jwtEncode.String(), ".")
		assert.Length(parts, 3)
		// Verify.
		jwtVerify, err := jwt.Verify(jwtEncode.String(), privateKey.Public())
		assert.Nil(err)
		assert.Equal(jwtEncode.Algorithm(), jwtVerify.Algorithm())
		assert.Equal(jwtEncode.String(), jwtVerify.String())
		testClaims(assert, jwtVerify.Claims())
	}
}
// TestESAlgorithms tests the ECDSA algorithms for the
// JWT signature.
TestESAlgorithms tests the ECDSA algorithms for the
JWT signature.
// TestESAlgorithms tests the ECDSA algorithms for the // JWT signature .
func TestESAlgorithms(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	assert.Nil(err)
	claims := initClaims()
	for _, test := range esTests {
		assert.Logf("testing algorithm %q", test)
		jwtEncode, err := jwt.Encode(claims, privateKey, test)
		assert.Nil(err)
		parts := strings.Split(jwtEncode.String(), ".")
		assert.Length(parts, 3)
		jwtVerify, err := jwt.Verify(jwtEncode.String(), privateKey.Public())
		assert.Nil(err)
		assert.Equal(jwtEncode.Algorithm(), jwtVerify.Algorithm())
		assert.Equal(jwtEncode.String(), jwtVerify.String())
		testClaims(assert, jwtVerify.Claims())
	}
}
func TestESAlgorithms ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) privateKey , err := ecdsa . GenerateKey ( elliptic . P256 ( ) , rand . Reader ) assert . Nil ( err ) claims := initClaims ( ) for _ , test := range esTests { assert . Logf ( " " , test ) jwtEncode , err := jwt . Encode ( claims , privateKey , test ) assert . Nil ( err ) parts := strings . Split ( jwtEncode . String ( ) , " " ) assert . Length ( parts , 3 ) jwtVerify , err := jwt . Verify ( jwtEncode . String ( ) , privateKey . Public ( ) ) assert . Nil ( err ) assert . Equal ( jwtEncode . Algorithm ( ) , jwtVerify . Algorithm ( ) ) assert . Equal ( jwtEncode . String ( ) , jwtVerify . String ( ) ) testClaims ( assert , jwtVerify . Claims ( ) ) } }
TestESAlgorithms tests the ECDSA algorithms for the
JWT signature.
TestESAlgorithms tests the ECDSA algorithms for the JWT signature .
// Encode. // Verify.