Skip to content

Commit

Permalink
change expiration name
Browse files Browse the repository at this point in the history
  • Loading branch information
madestro committed May 24, 2019
1 parent a6115db commit 2596cc2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkcs11-signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func findObject(p *Ctx, session SessionHandle, template []*(Attribute)) []Object
func generateRSAKeyPair(p *Ctx, session SessionHandle, tokenLabel string, tokenPersistent bool, bits int) (ObjectHandle, ObjectHandle) {

today := time.Now()
nextyear := today.AddDate(1, 0, 0)
expiration := today.AddDate(1, 0, 0)

publicKeyTemplate := []*Attribute{
NewAttribute(CKA_CLASS, CKO_PUBLIC_KEY),
Expand All @@ -59,7 +59,7 @@ func generateRSAKeyPair(p *Ctx, session SessionHandle, tokenLabel string, tokenP
NewAttribute(CKA_KEY_TYPE, CKK_RSA),
NewAttribute(CKA_TOKEN, tokenPersistent),
NewAttribute(CKA_START_DATE, today),
NewAttribute(CKA_END_DATE, nextyear),
NewAttribute(CKA_END_DATE, expiration),
NewAttribute(CKA_VERIFY, true),
NewAttribute(CKA_PUBLIC_EXPONENT, []byte{1, 0, 1}),
NewAttribute(CKA_MODULUS_BITS, bits),
Expand All @@ -72,11 +72,9 @@ func generateRSAKeyPair(p *Ctx, session SessionHandle, tokenLabel string, tokenP
NewAttribute(CKA_KEY_TYPE, CKK_RSA),
NewAttribute(CKA_TOKEN, tokenPersistent),
NewAttribute(CKA_START_DATE, today),
NewAttribute(CKA_END_DATE, nextyear),
NewAttribute(CKA_END_DATE, expiration),
NewAttribute(CKA_SIGN, true),
NewAttribute(CKA_SENSITIVE, true),
// NewAttribute(CKA_PRIVATE, true),
// NewAttribute(CKA_EXTRACTABLE, true),
}

pbk, pvk, e := p.GenerateKeyPair(session,
Expand Down

0 comments on commit 2596cc2

Please sign in to comment.