Skip to content

Golang implementation of this library #414

Open

Description

@font

Description

In order to more effectively integrate with cloud native applications, it would be ideal to have a Golang implementation of this library. This would help facilitate a more direct and synchronous approach to signing and verifying models that can be called directly from Golang applications without relying on techniques for calling into libraries written in other programming languages i.e. python in this case.

Activity

  1. mihaimaruseac commented on Apr 4, 2025

    @mihaimaruseac
    Member

    Something we should really add, agree.

    Unsure if this would be for a v1.1 release or a v2.0 release, but we can discuss in the meetings.

  2. added this to the Next release milestone on Oct 9, 2025
  3. sampras343 commented on Jan 20, 2026

    @sampras343
    Contributor

    Hi @mihaimaruseac and @font ,
    I wanted to keep you informed that I’ve started working on this and have made decent progress.

  4. mihaimaruseac commented on Jan 20, 2026

    @mihaimaruseac
    Member

    Nice! We are in the process of moving to a standardized spec in https://github.com/ossf/model-signing-spec. This way, any language binding, created manually or with AI, can target the same spec, without having to replicate this project's structure where it doesn't make sense.

  5. spencerschrock commented on Jan 20, 2026

    @spencerschrock
    Contributor

    I wanted to keep you informed that I’ve started working on this and have made decent progress.

    Can you talk about the high level Go interfaces in the design? And if you're embedding any structs or otherwise about the composability?

  6. sampras343 commented on Feb 12, 2026

    @sampras343
    Contributor

    @spencerschrock
    Apologies for the delay in my response.

    The repository is in decent shape to give it a try.

    Repository Link: https://github.com/sampras343/model-transparency-go

    As for your question, I suppose most of them are answered on sigstore/TSC#61 or in the repository under examples section.

    Pasting the image FYR,

    Image

  7. sampras343 commented on Feb 12, 2026

    @sampras343
    Contributor

    Additional information on the CLI interface can be found here sigstore/TSC#61 (comment)

    An example on how the go-lib is expected to be used (from an High Level interface POV):

    Key-based

    // Sign
    import keySigning "github.com/sigstore/model-signing/pkg/signing/key"
    
    opts := keySigning.KeySignerOptions{
        ModelPath:      "/path/to/model",
        SignaturePath:  "/path/to/model.sig",
        PrivateKeyPath: "/path/to/private-key.pem",
        Password:       "", // optional
        IgnorePaths:    nil,
        IgnoreGitPaths: true,
        AllowSymlinks:  false,
        Logger:         logger,
    }
    signer, err := keySigning.NewKeySigner(opts)
    result, err := signer.Sign(ctx)
    // Verify
    import keyVerify "github.com/sigstore/model-signing/pkg/verify/key"
    
    opts := keyVerify.KeyVerifierOptions{
        ModelPath:           "/path/to/model",
        SignaturePath:       "/path/to/model.sig",
        PublicKeyPath:      "/path/to/public-key.pem",
        IgnorePaths:        nil,
        IgnoreGitPaths:     true,
        AllowSymlinks:      false,
        IgnoreUnsignedFiles: false,
        Logger:             logger,
    }
    verifier, err := keyVerify.NewKeyVerifier(opts)
    result, err := verifier.Verify(ctx)

    A similar structure is maintained throughout other signing and verifying strategies as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions