Versions in this module Expand all Collapse all v1 v1.4.8 Jul 31, 2020 Changes in this version + const SecretTag + const TagDefault + const TagHelp + const TagHide + const TagOpt + const TagSkip + var ErrNotImplemented = errors.New("NOT YET IMPLEMENTED") + var RevocationReasonCodes = map[string]int + var URLRegex = regexp.MustCompile("(ldap|http)s*://(\\S+):(\\S+)@") + func B64Decode(str string) (buf []byte, err error) + func B64Encode(buf []byte) string + func BCCSPKeyRequestGenerate(req *csr.CertificateRequest, myCSP bccsp.BCCSP) (bccsp.Key, crypto.Signer, error) + func BccspBackedSigner(caFile, keyFile string, policy *config.Signing, csp bccsp.BCCSP) (signer.Signer, error) + func CheckHostsInCert(certFile string, hosts ...string) error + func CmdRunBegin(v *viper.Viper) + func ConfigureBCCSP(optsPtr **factory.FactoryOpts, mspDir, homeDir string) error + func CopyMissingValues(src, dst interface{}) + func CreateClientHome() (string, error) + func CreateToken(csp bccsp.BCCSP, cert []byte, key bccsp.Key, method, uri string, body []byte) (string, error) + func DecodeToken(token string) (*x509.Certificate, string, string, error) + func ErrorContains(t *testing.T, err error, contains, msg string, args ...interface{}) + func Fatal(format string, v ...interface{}) + func FatalError(t *testing.T, err error, msg string, args ...interface{}) + func FileExists(name string) bool + func FlagString(v *viper.Viper, flags *pflag.FlagSet, name, short string, def string, ...) + func GenECDSAToken(csp bccsp.BCCSP, cert []byte, key bccsp.Key, method, uri string, body []byte) (string, error) + func GetBCCSP(opts *factory.FactoryOpts, homeDir string) (bccsp.BCCSP, error) + func GetCertificateDuration(cert *x509.Certificate) time.Duration + func GetCertificateDurationFromFile(file string) (time.Duration, error) + func GetCommandLineOptValue(optName string, remove bool) string + func GetDefaultBCCSP() bccsp.BCCSP + func GetDefaultConfigFile(cmdName string) string + func GetECPrivateKey(raw []byte) (*ecdsa.PrivateKey, error) + func GetEnrollmentIDFromPEM(cert []byte) (string, error) + func GetEnrollmentIDFromX509Certificate(cert *x509.Certificate) string + func GetMaskedURL(url string) string + func GetRSAPrivateKey(raw []byte) (*rsa.PrivateKey, error) + func GetSerialAsHex(serial *big.Int) string + func GetServerAddr() string + func GetServerPort() string + func GetServerProtocol() string + func GetServerURL() string + func GetSignerFromCert(cert *x509.Certificate, csp bccsp.BCCSP) (bccsp.Key, crypto.Signer, error) + func GetSignerFromCertFile(certFile string, csp bccsp.BCCSP) (bccsp.Key, crypto.Signer, *x509.Certificate, error) + func GetSliceFromList(split string, delim string) []string + func GetUser(v *viper.Viper) (string, string, error) + func GetX509CertificateFromPEM(cert []byte) (*x509.Certificate, error) + func GetX509CertificateFromPEMFile(file string) (*x509.Certificate, error) + func GetX509CertificatesFromPEM(pemBytes []byte) ([]*x509.Certificate, error) + func HTTPRequestToString(req *http.Request) string + func HTTPResponseToString(resp *http.Response) string + func Hostname() string + func ImportBCCSPKeyFromPEM(keyFile string, myCSP bccsp.BCCSP, temporary bool) (bccsp.Key, error) + func InitBCCSP(optsPtr **factory.FactoryOpts, mspDir, homeDir string) (bccsp.BCCSP, error) + func IsSubsetOf(small, big string) error + func ListContains(list, find string) bool + func LoadX509KeyPair(certFile, keyFile string, csp bccsp.BCCSP) (*tls.Certificate, error) + func MakeFileAbs(file, dir string) (string, error) + func MakeFileNamesAbsolute(files []*string, home string) error + func Marshal(from interface{}, what string) ([]byte, error) + func NormalizeFileList(files []string, homeDir string) ([]string, error) + func NormalizeStringSlice(slice []string) []string + func ParseObj(obj interface{}, cb func(*Field) error, tags map[string]string) error + func RandomString(n int) string + func Read(r io.Reader, data []byte) ([]byte, error) + func ReadFile(file string) ([]byte, error) + func RegisterFlags(v *viper.Viper, flags *pflag.FlagSet, config interface{}, ...) error + func RemoveQuotes(str string) string + func SetDefaultServerPort() + func StrContained(str string, strs []string) bool + func StructToString(si interface{}) string + func Unmarshal(from []byte, to interface{}, what string) error + func ValidateAndReturnAbsConf(configFilePath, homeDir, cmdName string) (string, string, error) + func VerifyToken(csp bccsp.BCCSP, token string, method, uri string, body []byte, ...) (*x509.Certificate, error) + func ViperUnmarshal(cfg interface{}, stringSliceFields []string, vp *viper.Viper) error + func WriteFile(file string, buf []byte, perm os.FileMode) error + type ECDSASignature struct + R *big.Int + S *big.Int + type Field struct + Addr interface{} + Depth int + Hide string + Kind reflect.Kind + Leaf bool + Name string + Path string + Tag reflect.StructTag + Type reflect.Type + Value interface{}