diff --git a/signer/jws_test.go b/signer/jws_test.go index f44ed8f1..729e67ed 100644 --- a/signer/jws_test.go +++ b/signer/jws_test.go @@ -4,9 +4,10 @@ import ( "crypto/x509" "encoding/json" "errors" - "github.com/notaryproject/notation-core-go/internal/testhelper" "reflect" "testing" + + "github.com/notaryproject/notation-core-go/internal/testhelper" ) // Tests various scenarios around newJWSEnvelopeFromBytes method diff --git a/signer/jwt.go b/signer/jwt.go index eb82c36f..ac39d90b 100644 --- a/signer/jwt.go +++ b/signer/jwt.go @@ -6,6 +6,7 @@ import ( "crypto/rsa" "encoding/base64" "fmt" + "github.com/golang-jwt/jwt/v4" ) diff --git a/signer/signer.go b/signer/signer.go index c74f8e70..a0213b8b 100644 --- a/signer/signer.go +++ b/signer/signer.go @@ -3,8 +3,9 @@ package signer import ( "crypto/x509" "fmt" - nx509 "github.com/notaryproject/notation-core-go/x509" "time" + + nx509 "github.com/notaryproject/notation-core-go/x509" ) type SignatureMediaType string diff --git a/signer/signer_test.go b/signer/signer_test.go index 0c5e7e74..0310af0a 100644 --- a/signer/signer_test.go +++ b/signer/signer_test.go @@ -9,12 +9,13 @@ import ( "encoding/base64" "encoding/json" "errors" - "github.com/notaryproject/notation-core-go/internal/testhelper" "reflect" "sort" "strings" "testing" "time" + + "github.com/notaryproject/notation-core-go/internal/testhelper" ) const ( @@ -32,6 +33,7 @@ const ( var ( TestTamperedSig = strings.Replace(TestValidSig, "0fX0", "1fX0=", 1) ) + func TestNewSignatureEnvelopeFromBytesError(t *testing.T) { _, err := NewSignatureEnvelopeFromBytes([]byte("Malformed"), MediaTypeJWSJson) if !(err != nil && errors.As(err, new(MalformedArgumentError))) {