oauth

package
v0.0.0-...-3f23445 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCertificate

func GenerateCertificate(
	nfType, nfId, certPemPath string,
	pubKey *rsa.PublicKey,
	rootCert *x509.Certificate,
	rootPrivKey *rsa.PrivateKey,
) (*x509.Certificate, error)

func GenerateClientCredentialAssertion

func GenerateClientCredentialAssertion(
	sub, aud, keyPath string,
) (string, error)

func GenerateRSAKeyPair

func GenerateRSAKeyPair(pubPemPath, privPemPath string) (*rsa.PrivateKey, error)

func GenerateRootCertificate

func GenerateRootCertificate(
	rootCertPath string,
	rootPrivKey *rsa.PrivateKey,
) (*x509.Certificate, error)

func GetNFCertFileName

func GetNFCertFileName(nfType, nfId string) string

func GetNFCertPath

func GetNFCertPath(base, nfType, nfId string) string

func GetTokenCtx

func GetTokenCtx(
	nfType models.NfType,
	nfId, nrfUri, scope, targetNF string,
) (context.Context, *models.ProblemDetails, error)

func ParseCertFromPEM

func ParseCertFromPEM(certPemPath string) (*x509.Certificate, error)

func ParsePrivateKeyFromPEM

func ParsePrivateKeyFromPEM(privPemPath string) (*rsa.PrivateKey, error)

func ParsePublicKeyFromPEM

func ParsePublicKeyFromPEM(pubPemPath string) (*rsa.PublicKey, error)

func VerifyOAuth

func VerifyOAuth(
	authorization, serviceName, certPath string,
) error

Types

type CCAClaims

type CCAClaims struct {
	Iat int32
	Exp int32
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL