x509tools

package module
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

README

x509tools License GoDoc Go Report Card

import "toolman.org/crypto/x509tools"

This package contains several x509-related helper functions not found in the standard library (albeit, perhaps they should be).

A non-trivial portion of this logic was take directly from the unexported side of the standard library's "crypto/x509" package -- therefore this package maintains the same copyright and license as the Go source code itself.

See the "LICENSE" file for more information.

Documentation

Overview

Package x509tools provides various x509 related helper functions that are not found in the standard library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyUsageExtension

func KeyUsageExtension(usage x509.KeyUsage) (pkix.Extension, error)

KeyUsageExtension converts the provided x509.KeyUsage bitmask to a pkix.Extension representing those values. Note that the returned Extension alaways has its Critical flag set.

If a non-nil error is returned, it will come from an asn1 marshaling falure and the Extension value should be ignored.

func KeyUsageString

func KeyUsageString(ku x509.KeyUsage) string

KeyUsageString returns a string representation of the provided KeyUsage value. For KeyUsage values with multiple bit set, the resultant string will contain a pipe-separated list of strings.

Types

type KeyUsage added in v0.6.1

type KeyUsage x509.KeyUsage

KeyUsage is a convenience wrapper around x509.KeyUsage that provides the String and Extension methods.

func (KeyUsage) Extension added in v0.6.1

func (ku KeyUsage) Extension() (pkix.Extension, error)

Extension is a wrapper around this package's KeyUsageExtension function.

func (KeyUsage) String added in v0.6.1

func (ku KeyUsage) String() string

String implements the fmt.Stringer interface for type KeyUsage.

Directories

Path Synopsis
Package skid provides type SKID, along with supporting functions and methods.
Package skid provides type SKID, along with supporting functions and methods.

Jump to

Keyboard shortcuts

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