spiegel_podman/vendor/github.com/containers/ocicrypt
tomsweeneyredhat 2ba0070cc4
Bump runc to 1.2.9, Buildah 1.29.6
Cherry picked from commit 2e8bce201e with
additional updates required for the v4.2.0-rhel branch.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>

Assisted by AI: Cursor <Auto>
Signed-off-by: Chris Evich <cevich@redhat.com>
2026-01-28 10:45:58 -05:00
..
blockcipher Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
config Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
crypto/pkcs11 Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
helpers Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
keywrap Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
spec Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
utils Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
.gitignore Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
.golangci.yml Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
ADOPTERS.md Bump github.com/containers/ocicrypt from 1.1.1 to 1.1.2 2021-06-29 12:30:56 +00:00
CODE-OF-CONDUCT.md Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
encryption.go Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
gpg.go Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
gpgvault.go Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
LICENSE vendor c/image v5.4.2 2020-04-07 12:09:48 +02:00
MAINTAINERS Vendor in containers/(common, storage, image) 2022-05-02 17:16:10 -04:00
Makefile Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00
reader.go build(deps): bump github.com/containers/image/v5 from 5.0.0 to 5.1.0 2019-12-20 09:30:47 -05:00
README.md Bump github.com/containers/ocicrypt from 1.1.1 to 1.1.2 2021-06-29 12:30:56 +00:00
SECURITY.md Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05:00

OCIcrypt Library

The ocicrypt library is the OCI image spec implementation of container image encryption. More details of the spec can be seen in the OCI repository. The purpose of this library is to encode spec structures and consts in code, as well as provide a consistent implementation of image encryption across container runtimes and build tools.

Consumers of OCIcrypt:

Usage

There are various levels of usage for this library. The main consumers of these would be runtime/build tools, and a more specific use would be in the ability to extend cryptographic function.

Runtime/Build tool usage

The general exposed interface a runtime/build tool would use, would be to perform encryption or decryption of layers:

package "github.com/containers/ocicrypt"
func EncryptLayer(ec *config.EncryptConfig, encOrPlainLayerReader io.Reader, desc ocispec.Descriptor) (io.Reader, EncryptLayerFinalizer, error)
func DecryptLayer(dc *config.DecryptConfig, encLayerReader io.Reader, desc ocispec.Descriptor, unwrapOnly bool) (io.Reader, digest.Digest, error)

The settings/parameters to these functions can be specified via creation of an encryption config with the github.com/containers/ocicrypt/config package. We note that because setting of annotations and other fields of the layer descriptor is done through various means in different runtimes/build tools, it is the responsibility of the caller to still ensure that the layer descriptor follows the OCI specification (i.e. encoding, setting annotations, etc.).

Crypto Agility and Extensibility

The implementation for both symmetric and asymmetric encryption used in this library are behind 2 main interfaces, which users can extend if need be. These are in the following packages:

  • github.com/containers/ocicrypt/blockcipher - LayerBlockCipher interface for block ciphers
  • github.com/containers/ocicrypt/keywrap - KeyWrapper interface for key wrapping

We note that adding interfaces here is risky outside the OCI spec is not recommended, unless for very specialized and confined usecases. Please open an issue or PR if there is a general usecase that could be added to the OCI spec.

Keyprovider interface

As part of the keywrap interface, there is a keyprovider implementation that allows one to call out to a binary or service.

Security Issues

We consider security issues related to this library critical. Please report and security related issues by emailing maintainers in the MAINTAINERS file.

Ocicrypt Pkcs11 Support

Ocicrypt Pkcs11 support is currently experiemental. For more details, please refer to the this document.