Documentation ¶
Index ¶
- func AccordPayloadType[T any](record token.PayloadType, value T) bool
- func GetPayload[T any](pwt *PWT, key string) (T, error)
- func IsAlreadySetAnotherTypeErr(err error) bool
- func IsInvalidHeaderErr(err error) bool
- func IsInvalidPayloadKeyErr(err error) bool
- func IsInvalidPayloadLengthErr(err error) bool
- func IsInvalidPayloadTypeErr(err error) bool
- func IsInvalidSignatureErr(err error) bool
- func MakeECPrivateKeyToPem(pk *ecdsa.PrivateKey) ([]byte, error)
- func MakeECPublicKeyToPem(pk *ecdsa.PublicKey) ([]byte, error)
- func MakeEd25519PrivateKeyToPem(pk ed25519.PrivateKey) ([]byte, error)
- func MakeEd25519PublicKeyToPem(pk ed25519.PublicKey) ([]byte, error)
- func NewEcdsaKey(curve elliptic.Curve) (*ecdsa.PrivateKey, error)
- func NewEcdsaKeyFromSeed(curve elliptic.Curve, seed []byte) (*ecdsa.PrivateKey, error)
- func NewEd25519Key() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func NewEd25519KeyFromSeed(seed []byte) (ed25519.PublicKey, ed25519.PrivateKey, error)
- func SetPayload[T any](pwt *PWT, key string, value T) error
- type PWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccordPayloadType ¶
func AccordPayloadType[T any](record token.PayloadType, value T) bool
func IsInvalidHeaderErr ¶
func IsInvalidPayloadKeyErr ¶
func IsInvalidPayloadTypeErr ¶
func IsInvalidSignatureErr ¶
func MakeECPrivateKeyToPem ¶
func MakeECPrivateKeyToPem(pk *ecdsa.PrivateKey) ([]byte, error)
func MakeEd25519PrivateKeyToPem ¶
func MakeEd25519PrivateKeyToPem(pk ed25519.PrivateKey) ([]byte, error)
func NewEcdsaKey ¶
func NewEcdsaKey(curve elliptic.Curve) (*ecdsa.PrivateKey, error)
func NewEcdsaKeyFromSeed ¶
func NewEd25519Key ¶
func NewEd25519Key() (ed25519.PublicKey, ed25519.PrivateKey, error)
func NewEd25519KeyFromSeed ¶
Types ¶
type PWT ¶
type PWT struct {
// contains filtered or unexported fields
}
func (*PWT) SetAlgorithm ¶
func (p *PWT) SetAlgorithm(sign token.SignatureAlgorithm, hash token.HashAlgorithm) *PWT
Click to show internal directories.
Click to hide internal directories.