{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Functions\n\n```go\nfunc AEStoEncryptedPEM(raw []byte, pwd []byte) ([]byte, error)\n```\nAEStoEncryptedPEM encapsulates an AES key in the encrypted PEM format\n\n```go\nfunc AEStoPEM(raw []byte) []byte\n```\nAEStoPEM encapsulates an AES key in the PEM format\n\n```go\nfunc Clone(src []byte) []byte\n```\nClone clones the passed slice\n\n```go\nfunc DERToPrivateKey(der []byte) (key interface{}, err error)\n```\nDERToPrivateKey unmarshals a der to private key\n\n```go\nfunc DERToPublicKey(raw []byte) (pub interface{}, err error)\n```\nDERToPublicKey unmarshals a der to public key\n\n```go\nfunc DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error)\n```\nDERToX509Certificate converts der to x509\n\n```go\nfunc DirEmpty(path string) (bool, error)\n```\nDirEmpty checks if a directory is empty\n\n```go\nfunc DirExists(path string) (bool, error)\n```\nDirExists checks if a directory exists\n\n```go\nfunc DirMissingOrEmpty(path string) (bool, error)\n```\nDirMissingOrEmpty checks is a directory is missing or empty\n\n```go\nfunc ErrToString(err error) string\n```\nErrToString converts and error to a string. If the error is nil, it returns the string \"\\\u003cclean\u003e\"\n\n```go\nfunc GetCurveHalfOrdersAt(c elliptic.Curve) *big.Int\n```\n\n```go\nfunc IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)\n```\nIsLow checks that s is a low-S\n\n```go\nfunc MarshalECDSASignature(r, s *big.Int) ([]byte, error)\n```\n\n```go\nfunc PEMtoAES(raw []byte, pwd []byte) ([]byte, error)\n```\nPEMtoAES extracts from the PEM an AES key\n\n```go\nfunc PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)\n```\nPEMtoPrivateKey unmarshals a pem to private key\n\n```go\nfunc PEMtoPublicKey(raw []byte, pwd []byte) (interface{}, error)\n```\nPEMtoPublicKey unmarshals a pem to public key\n\n```go\nfunc PrivateKeyToDER(privateKey *ecdsa.PrivateKey) ([]byte, error)\n```\nPrivateKeyToDER marshals a private key to der\n\n```go\nfunc PrivateKeyToEncryptedPEM(privateKey interface{}, pwd []byte) ([]byte, error)\n```\nPrivateKeyToEncryptedPEM converts a private key to an encrypted PEM\n\n```go\nfunc PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error)\n```\nPrivateKeyToPEM converts the private key to PEM format. EC private keys are converted to PKCS#8 format. RSA private keys are converted to PKCS#1 format.\n\n```go\nfunc PublicKeyToDER(publicKey interface{}) ([]byte, error)\n```\nPublicKeyToDER marshals a public key to the der format\n\n```go\nfunc PublicKeyToEncryptedPEM(publicKey interface{}, pwd []byte) ([]byte, error)\n```\nPublicKeyToEncryptedPEM converts a public key to encrypted pem\n\n```go\nfunc PublicKeyToPEM(publicKey interface{}, pwd []byte) ([]byte, error)\n```\nPublicKeyToPEM marshals a public key to the pem format\n\n```go\nfunc SignatureToLowS(k *ecdsa.PublicKey, signature []byte) ([]byte, error)\n```\n\n```go\nfunc ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)\n```\n\n```go\nfunc UnmarshalECDSASignature(raw []byte) (*big.Int, *big.Int, error)\n```\n\n## Types\n\n```go\ntype ECDSASignature struct {\n\tR, S *big.Int\n}\n```\n\n","path":"github.com/eric-erki/https-hyperledger.org/bccsp/utils","name":"utils","synopsis":"","isRedistributable":true}
