Giter VIP home page Giter VIP logo

signature's Introduction

SigNature

A mini executable/CLI tool to sign files and update Credential Logs. RSA private key and public key are generated using openssl can be used to sign and verify a file.

To build the executable:

go build -o SigNature.exe

Generate a rsa private and public keys using OpenSSL:

openssl genpkey -algorithm RSA -out <private_key_name>.pem -pkeyopt rsa_keygen_bits:2048

openssl rsa -in <private_key_name>.pem -pubout -out <public_key_name>.pem

To use the executable:

Usage: ./SigNature <commands>
Commands:
  sign -priv <private_key_file> -pub <public_key_file> -f <file>
  verify -pub <public_key_file> -f <file>

Sign

Use:

./SigNature sign -priv <private_key_file> -pub <public_key_file> -f <file>

As per the above command, the user provided file will be signed using the rsa private key under the SignPKCS1v15 format, further Metadata of "Hash:" or "SignedReference:" will be appended to the file. Further the File Name, File Hash Value, Signature Reference, Public Key Name, Key and the Signature Agent will be uploaded as a log to the CredentialLog via api call.

Verify

Use:

./SigNature verify -pub <public_key_file> -f <file>

As per the above command, the user provided file will be verified using the rsa public key under the VerifyPKCS1v15 format, further the VerifyFile function splits the file content into lines, the function can then iterate over each line and check if it starts with the metadata "Hash:" or "SignedReference:". If it does, it knows that the rest of the line after the prefix is the corresponding value. This value is then decoded from a hexadecimal string (for the hash) or a base64 string (for the signature) into a byte array. This approach allows for a flexible file structure where the hash and signature can appear in any order, and potentially additional metadata could be included in the same way. It assumes that each piece of metadata is on its own line and correctly prefixed.

signature's People

Contributors

miranlfk avatar

Watchers

 avatar

signature's Issues

Container Image Signing and Verification

Implement the signature functionality to sign container images hosted in the various container registries. Build the signing and verification functionality using the the same format, where the signature digest attaches to the tag of the container image. The credentials of the signed container images must be logged in the Credential Log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.