types

package
v0.0.6-beta Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PublicKeyAlgorithmStrings = map[string]PublicKeyAlgorithm{
	RSA.String(): {
		Algorithm: x509.RSA,
		KeySize: map[int]interface{}{
			2048: true,
			4096: true,
		},
		Signature: map[string]bool{
			"SHA256WITHRSA":    true,
			"SHA384WITHRSA":    true,
			"SHA512WITHRSA":    true,
			"SHA256WITHRSAPSS": true,
			"SHA384WITHRSAPSS": true,
			"SHA512WithRSAPSS": true,
		},
		SigningAlgorithm: map[x509.SignatureAlgorithm]bool{
			x509.SHA256WithRSA:    true,
			x509.SHA384WithRSA:    true,
			x509.SHA512WithRSA:    true,
			x509.SHA256WithRSAPSS: true,
			x509.SHA384WithRSAPSS: true,
			x509.SHA512WithRSAPSS: true,
		},
	},
	ECDSA.String(): {
		Algorithm: x509.ECDSA,
		KeySize: map[int]interface{}{
			256: elliptic.P256(),
			384: elliptic.P384(),
			521: elliptic.P521(),
		},
		Signature: map[string]bool{
			"SHA256WITHECDSA": true,
			"SHA384WITHECDSA": true,
			"SHA512WITHECDSA": true,
		},
		SigningAlgorithm: map[x509.SignatureAlgorithm]bool{
			x509.ECDSAWithSHA256: true,
			x509.ECDSAWithSHA384: true,
			x509.ECDSAWithSHA512: true,
		},
	},

	Ed25519.String(): {
		Algorithm: x509.Ed25519,
		KeySize: map[int]interface{}{
			256: true,
		},
	},
}
View Source
var PublicKeyAlgorithms = map[KeyType]PublicKeyAlgorithm{
	RSA: {
		Algorithm: x509.RSA,
		KeySize: map[int]interface{}{
			2048: true,
			4096: true,
		},
		Signature: map[string]bool{
			"SHA256WITHRSA":    true,
			"SHA384WITHRSA":    true,
			"SHA512WITHRSA":    true,
			"SHA256WITHRSAPSS": true,
			"SHA384WITHRSAPSS": true,
			"SHA512WithRSAPSS": true,
		},
		SigningAlgorithm: map[x509.SignatureAlgorithm]bool{
			x509.SHA256WithRSA:    true,
			x509.SHA384WithRSA:    true,
			x509.SHA512WithRSA:    true,
			x509.SHA256WithRSAPSS: true,
			x509.SHA384WithRSAPSS: true,
			x509.SHA512WithRSAPSS: true,
		},
	},
	ECDSA: {
		Algorithm: x509.ECDSA,
		KeySize: map[int]interface{}{
			256: elliptic.P256(),
			384: elliptic.P384(),
			521: elliptic.P521(),
		},
		Signature: map[string]bool{
			"SHA256WITHECDSA": true,
			"SHA384WITHECDSA": true,
			"SHA512WITHECDSA": true,
		},
		SigningAlgorithm: map[x509.SignatureAlgorithm]bool{
			x509.ECDSAWithSHA256: true,
			x509.ECDSAWithSHA384: true,
			x509.ECDSAWithSHA512: true,
		},
	},

	Ed25519: {
		Algorithm: x509.Ed25519,
		KeySize: map[int]interface{}{
			256: true,
		},
	},
}
View Source
var ValidSignatures = map[string]SigningAlgorithm{
	"SHA256WITHECDSA": {
		Common: x509.ECDSAWithSHA256,
		PCA:    types.SigningAlgorithmSha256withecdsa,
	},
	"SHA384WITHECDSA": {
		Common: x509.ECDSAWithSHA384,
		PCA:    types.SigningAlgorithmSha384withecdsa,
	},
	"SHA512WITHECDSA": {
		Common: x509.ECDSAWithSHA512,
		PCA:    types.SigningAlgorithmSha512withecdsa,
	},
	"SHA256WITHRSA": {
		Common: x509.SHA256WithRSA,
		PCA:    types.SigningAlgorithmSha256withrsa,
	},
	"SHA384WITHRSA": {
		Common: x509.SHA384WithRSA,
		PCA:    types.SigningAlgorithmSha384withrsa,
	},
	"SHA512WITHRSA": {
		Common: x509.SHA512WithRSA,
		PCA:    types.SigningAlgorithmSha512withrsa,
	},
}

Functions

This section is empty.

Types

type CertificateRequest

type CertificateRequest struct {
	CommonName            string
	SubjectAlternateNames []string
	DistinguishedName     DistinguishedName
	SigningAlgorithm      x509.SignatureAlgorithm
	PublicKeyAlgorithm    x509.PublicKeyAlgorithm
	KeySize               int
	Output                Output
}

type Data

type Data struct {
	Raw    *[]byte
	Path   Path
	Reader Reader
}

type DistinguishedName

type DistinguishedName struct {
	Country            []string
	Province           []string
	Locality           []string
	Organization       []string
	OrganizationalUnit []string
	StreetAddress      []string
	PostalCode         []string
	SerialNumber       string
}

type KeyType

type KeyType uint
const (
	RSA_PRIVATE_KEY KeyType = iota
	ECDSA_PRIVATE_KEY
	PKCS8_PRIVATE_KEY
	CERTIFICATE
	CERTIFICATE_REQUEST
	RSA
	ECDSA
	Ed25519
)

func (KeyType) String

func (k KeyType) String() string

type Manifest

type Manifest struct {
	CertificateChain []*x509.Certificate
	SigningAlgorithm x509.SignatureAlgorithm
	Signature        *[]byte
	Hash             *[]byte
	Data             Data
}

type Output

type Output struct {
	CertificateSigningRequest    string
	Certificate                  string
	IntermediateCertificateChain string
	RootCertificateChain         string
	PrivateKey                   string
}

type Path

type Path struct {
	File   string
	Buffer int
}

type PublicKeyAlgorithm

type PublicKeyAlgorithm struct {
	Algorithm        x509.PublicKeyAlgorithm
	KeySize          map[int]interface{}
	Signature        map[string]bool
	SigningAlgorithm map[x509.SignatureAlgorithm]bool
}

type Reader

type Reader struct {
	Interface io.Reader
	Buffer    int
}

type Signature

type Signature struct {
	CertificateRequest CertificateRequest
	SigningAlgorithm   x509.SignatureAlgorithm
	Data
}

type SignedCertificate

type SignedCertificate struct {
	CertificatePath                  string
	IntermediateCertificateChainPath string
	RootCertificateChainPath         string
}

type SigningAlgorithm

type SigningAlgorithm struct {
	Common x509.SignatureAlgorithm
	PCA    types.SigningAlgorithm
}

type SigningRequest

type SigningRequest struct {
	CSR          *bytes.Buffer
	PrivateKey   *pem.Block
	EncodedPKCS8 []byte
}

type TrustChain

type TrustChain struct {
	CommonName                    string
	CertificateAuthorityDirectory []string
	CertificateAuthorityFiles     []string
}

Jump to

Keyboard shortcuts

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