summaryrefslogtreecommitdiff
path: root/vendor/github.com/docker/libtrust/hash.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-04 13:26:38 -0700
committerGitHub <noreply@github.com>2019-10-04 13:26:38 -0700
commit2c2782a2179aee6c76d90e864708e2e5ceb09349 (patch)
treec61aa40e008b7fcb371d899880a4afd1714f50af /vendor/github.com/docker/libtrust/hash.go
parentbd08fc0e9b3a9943008585879877b68789e38c31 (diff)
parentd3f59bedb393521986e645bc48c47938f321b643 (diff)
downloadpodman-2c2782a2179aee6c76d90e864708e2e5ceb09349.tar.gz
podman-2c2782a2179aee6c76d90e864708e2e5ceb09349.tar.bz2
podman-2c2782a2179aee6c76d90e864708e2e5ceb09349.zip
Merge pull request #4165 from mtrmac/c-image-4
Update c/image to v4.0.0 + Buildah to 1.11.3
Diffstat (limited to 'vendor/github.com/docker/libtrust/hash.go')
-rw-r--r--vendor/github.com/docker/libtrust/hash.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/vendor/github.com/docker/libtrust/hash.go b/vendor/github.com/docker/libtrust/hash.go
deleted file mode 100644
index a2df787dd..000000000
--- a/vendor/github.com/docker/libtrust/hash.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package libtrust
-
-import (
- "crypto"
- _ "crypto/sha256" // Registrer SHA224 and SHA256
- _ "crypto/sha512" // Registrer SHA384 and SHA512
- "fmt"
-)
-
-type signatureAlgorithm struct {
- algHeaderParam string
- hashID crypto.Hash
-}
-
-func (h *signatureAlgorithm) HeaderParam() string {
- return h.algHeaderParam
-}
-
-func (h *signatureAlgorithm) HashID() crypto.Hash {
- return h.hashID
-}
-
-var (
- rs256 = &signatureAlgorithm{"RS256", crypto.SHA256}
- rs384 = &signatureAlgorithm{"RS384", crypto.SHA384}
- rs512 = &signatureAlgorithm{"RS512", crypto.SHA512}
- es256 = &signatureAlgorithm{"ES256", crypto.SHA256}
- es384 = &signatureAlgorithm{"ES384", crypto.SHA384}
- es512 = &signatureAlgorithm{"ES512", crypto.SHA512}
-)
-
-func rsaSignatureAlgorithmByName(alg string) (*signatureAlgorithm, error) {
- switch {
- case alg == "RS256":
- return rs256, nil
- case alg == "RS384":
- return rs384, nil
- case alg == "RS512":
- return rs512, nil
- default:
- return nil, fmt.Errorf("RSA Digital Signature Algorithm %q not supported", alg)
- }
-}
-
-func rsaPKCS1v15SignatureAlgorithmForHashID(hashID crypto.Hash) *signatureAlgorithm {
- switch {
- case hashID == crypto.SHA512:
- return rs512
- case hashID == crypto.SHA384:
- return rs384
- case hashID == crypto.SHA256:
- fallthrough
- default:
- return rs256
- }
-}