Coder Social home page Coder Social logo

Provide crypto.Signer interface about pkcs11 HOT 5 CLOSED

miekg avatar miekg commented on August 21, 2024 1
Provide crypto.Signer interface

from pkcs11.

Comments (5)

optnfast avatar optnfast commented on August 21, 2024 2

Hi, https://github.com/thalesignite/crypto11 implements crypto.Signer in terms of miekg/pkcs11.

from pkcs11.

fzakaria avatar fzakaria commented on August 21, 2024 1

Here is a use case I am envisioning (create an ssh ClientConfig)

	u, err := user.Current()
	if err != nil {
		return nil, err
	}

	pin := "my fake pin"
        module, _ := p11ez.OpenModule("/path/to/module.so")
        slots, _ := module.Slots()
        session, _ := slots[0].OpenSession()
        session.Login(user, pin)


        pk, _ := session.FindObject(CKO_PRIVATE_KEY)
        
       privateKeySigner := p11ez.PrivateKey(pk)
        signer, err := ssh.NewSignerFromSigner(privateKeySigner)
	
        return &ssh.ClientConfig{
		User: u.Username,
		Auth: []ssh.AuthMethod{
			ssh.PublicKeys(signer),
		},
	}, nil

from pkcs11.

miekg avatar miekg commented on August 21, 2024

Nice plan! Maybe we should do it in #56? (or after that is merged)

from pkcs11.

miekg avatar miekg commented on August 21, 2024

Just should be mentioned in the README I think. Care for a PR?

from pkcs11.

optnfast avatar optnfast commented on August 21, 2024

#58

from pkcs11.

Related Issues (20)

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.