code: func rsaGenerate(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label string, modulusLen, pubExponent uint) (*rsa.PublicKey, error) {
  	keyID := make([]byte, 4)
  	_, err := rand.Read(keyID)
  	if err != nil {
  		return nil, err
  	}
  	log.Printf("Generating RSA key with %d bit modulus and public exponent %d and ID %x\n", modulusLen, pubExponent, keyID)
  	args := rsaArgs(label, modulusLen, pubExponent, keyID)
  	pub, priv, err := ctx.GenerateKeyPair(session, args.mechanism, args.publicAttrs, args.privateAttrs)
  	if err != nil {
  		return nil, err
  	}
  	log.Println("Key generated")
  	log.Println("Extracting public key")
  	pk, err := rsaPub(ctx, session, pub, modulusLen, pubExponent)
  	if err != nil {
  		return nil, err
  	}
  	log.Println("Extracted public key")
  	log.Println("Verifying public key")
  	err = rsaVerify(ctx, session, priv, pk)
  	if err != nil {
  		return nil, err
  	}
  	return pk, nil
  }
docs: // rsaGenerate is used to generate and verify a RSA key pair of the size
  // specified by modulusLen and with the exponent specified by pubExponent.
  // It returns the public part of the generated key pair as a rsa.PublicKey.