// Code generated by "stringer -type SignatureAlgorithm,PublicKeyAlgorithm,KeyUsage,ExtKeyUsage -output strings.go"; DO NOT EDIT

package main

import "fmt"
import "strings"

const _SignatureAlgorithm_name = "UnknownSignatureAlgorithmMD2WithRSAMD5WithRSASHA1WithRSASHA256WithRSASHA384WithRSASHA512WithRSADSAWithSHA1DSAWithSHA256ECDSAWithSHA1ECDSAWithSHA256ECDSAWithSHA384ECDSAWithSHA512"

var _SignatureAlgorithm_index = [...]uint8{0, 25, 35, 45, 56, 69, 82, 95, 106, 119, 132, 147, 162, 177}

func (i SignatureAlgorithm) String() string {
	if i < 0 || i >= SignatureAlgorithm(len(_SignatureAlgorithm_index)-1) {
		return fmt.Sprintf("SignatureAlgorithm(%d)", i)
	}
	return _SignatureAlgorithm_name[_SignatureAlgorithm_index[i]:_SignatureAlgorithm_index[i+1]]
}

const _PublicKeyAlgorithm_name = "UnknownPublicKeyAlgorithmRSADSAECDSA"

var _PublicKeyAlgorithm_index = [...]uint8{0, 25, 28, 31, 36}

func (i PublicKeyAlgorithm) String() string {
	if i < 0 || i >= PublicKeyAlgorithm(len(_PublicKeyAlgorithm_index)-1) {
		return fmt.Sprintf("PublicKeyAlgorithm(%d)", i)
	}
	return _PublicKeyAlgorithm_name[_PublicKeyAlgorithm_index[i]:_PublicKeyAlgorithm_index[i+1]]
}

const (
	_KeyUsage_name_0 = "KeyUsageDigitalSignatureKeyUsageContentCommitment"
	_KeyUsage_name_1 = "KeyUsageKeyEncipherment"
	_KeyUsage_name_2 = "KeyUsageDataEncipherment"
	_KeyUsage_name_3 = "KeyUsageKeyAgreement"
	_KeyUsage_name_4 = "KeyUsageCertSign"
	_KeyUsage_name_5 = "KeyUsageCRLSign"
	_KeyUsage_name_6 = "KeyUsageEncipherOnly"
	_KeyUsage_name_7 = "KeyUsageDecipherOnly"
)

var (
	_KeyUsage_index_0 = [...]uint8{0, 24, 49}
	_KeyUsage_index_1 = [...]uint8{0, 23}
	_KeyUsage_index_2 = [...]uint8{0, 24}
	_KeyUsage_index_3 = [...]uint8{0, 20}
	_KeyUsage_index_4 = [...]uint8{0, 16}
	_KeyUsage_index_5 = [...]uint8{0, 15}
	_KeyUsage_index_6 = [...]uint8{0, 20}
	_KeyUsage_index_7 = [...]uint8{0, 20}
)

func (i KeyUsage) String() string {
	s := ""
	sep := ""
	for m := 1; m != 0; m <<= 2 {
		if j := i & KeyUsage(m); j != 0 {
			s += sep + strings.TrimPrefix(j.String2(), "KeyUsage")
			sep = " "
		}
	}
	return s
}

func (i KeyUsage) String2() string {
	switch {
	case 1 <= i && i <= 2:
		i -= 1
		return _KeyUsage_name_0[_KeyUsage_index_0[i]:_KeyUsage_index_0[i+1]]
	case i == 4:
		return _KeyUsage_name_1
	case i == 8:
		return _KeyUsage_name_2
	case i == 16:
		return _KeyUsage_name_3
	case i == 32:
		return _KeyUsage_name_4
	case i == 64:
		return _KeyUsage_name_5
	case i == 128:
		return _KeyUsage_name_6
	case i == 256:
		return _KeyUsage_name_7
	default:
		return fmt.Sprintf("KeyUsage(%d)", i)
	}
}

const _ExtKeyUsage_name = "invalidUsageExtKeyUsageAnyExtKeyUsageServerAuthExtKeyUsageClientAuthExtKeyUsageCodeSigningExtKeyUsageEmailProtectionExtKeyUsageIPSECEndSystemExtKeyUsageIPSECTunnelExtKeyUsageIPSECUserExtKeyUsageTimeStampingExtKeyUsageOCSPSigningExtKeyUsageMicrosoftServerGatedCryptoExtKeyUsageNetscapeServerGatedCrypto"

var _ExtKeyUsage_index = [...]uint16{0, 12, 26, 47, 68, 90, 116, 141, 163, 183, 206, 228, 265, 301}

func (i ExtKeyUsage) String() string {
	i -= -1
	if i < 0 || i >= ExtKeyUsage(len(_ExtKeyUsage_index)-1) {
		return fmt.Sprintf("ExtKeyUsage(%d)", i+-1)
	}
	return _ExtKeyUsage_name[_ExtKeyUsage_index[i]:_ExtKeyUsage_index[i+1]]
}
