Documentation ¶
Index ¶
Constants ¶
View Source
const EthereumJWTLength = 32
JWTLength defines the length of the JWT byte array to be 32 bytes as defined the Engine API specification. https://github.com/ethereum/execution-apis/blob/main/src/engine/authentication.md
Variables ¶
View Source
var ( // ErrLengthMismatch is returned when a JWT secret length is not as // expected. ErrLengthMismatch = errors.New( "JWT secret length mismatch") // ErrContainsIllegalCharacter is returned when a JWT secret contains // illegal characters. ErrContainsIllegalCharacter = errors.New( "JWT secret contains illegal character(s)") )
View Source
var HexRegexp = regexp.MustCompile(`^(?:0x)?[0-9a-fA-F]*$`)
HexRegexp is a regular expression to match hexadecimal characters.
Functions ¶
This section is empty.
Types ¶
type Secret ¶
type Secret [EthereumJWTLength]byte
Secret represents a JSON Web Token as a fixed-size byte array.
func LoadFromFile ¶
LoadFromFile reads the JWT secret from a file and returns it.
func NewFromHex ¶
NewFromHex creates a new JWT secret from a hexadecimal string.
func (*Secret) BuildSignedJWT ¶
BuildSignedJWT builds a signed JWT from the provided JWT secret.
Click to show internal directories.
Click to hide internal directories.