code: func rsaPub(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, modulusLen, exponent uint) (*rsa.PublicKey, error) {
  	pubKey, err := pkcs11helpers.GetRSAPublicKey(ctx, session, object)
  	if err != nil {
  		return nil, err
  	}
  	if pubKey.E != int(exponent) {
  		return nil, errors.New("returned CKA_PUBLIC_EXPONENT doesn't match expected exponent")
  	}
  	if pubKey.N.BitLen() != int(modulusLen) {
  		return nil, errors.New("returned CKA_MODULUS isn't of the expected bit length")
  	}
  	log.Printf("\tPublic exponent: %d\n", pubKey.E)
  	log.Printf("\tModulus: (%d bits) %X\n", pubKey.N.BitLen(), pubKey.N.Bytes())
  	return pubKey, nil
  }
docs: // rsaPub extracts the generated public key, specified by the provided object
  // handle, and constructs a rsa.PublicKey. It also checks that the key has the
  // correct length modulus and that the public exponent is what was requested in
  // the public key template.