Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GQ256 = jwa.SignatureAlgorithm("GQ256")
Functions ¶
func OriginalJWTHeaders ¶
Types ¶
type Signer ¶
type Signer interface { // Sign creates a GQ1 signature over the given message with the given GQ1 private number. Sign(private []byte, message []byte) ([]byte, error) // SignJWT creates a GQ1 signature over the JWT token's header/payload with a GQ1 private number derived from the JWT signature. // // This works because a GQ1 private number can be calculated as the inverse mod n of an RSA signature, where n is the public RSA modulus. SignJWT(jwt []byte) ([]byte, error) }
Signer allows for creating GQ1 signatures messages.
type SignerVerifier ¶
SignerVerifier combines the Signer and Verifier interfaces.
func NewSignerVerifier ¶
func NewSignerVerifier(publicKey *rsa.PublicKey, securityParameter int) (SignerVerifier, error)
NewSignerVerifier creates a SignerVerifier from the RSA public key of the trusted third-party which creates the GQ1 private numbers.
The securityParameter parameter is the level of desired security in bits. 256 is recommended.
type Verifier ¶
type Verifier interface { // Verify verifies a GQ1 signature over a message, using the public identity of the signer. Verify(signature []byte, identity []byte, message []byte) bool // Compatible with SignJWT, this function verifies the GQ1 signature of the presented JSON Web Token. VerifyJWT(jwt []byte) bool }
Signer allows for verifying GQ1 signatures.
Click to show internal directories.
Click to hide internal directories.