user3436467
user3436467

Reputation: 1775

phpseclib csr and key generation

I am using phpseclib to create private key,public key and csr but i couldnt work out where I can specify the keysize and signaturealgorithm.. by default they are 1024bit and sha1WithRSAEncryption however I would like to specify a stronger combination.

According to the documentation here http://phpseclib.bantux.org/api/master/phpseclib/File/X509.html it only has examples for Sha1

signCSR($signatureAlgorithm = 'sha1WithRSAEncryption')

thanks in advance!

Upvotes: 0

Views: 342

Answers (1)

user3436467
user3436467

Reputation: 1775

To specify the keysize use: createKey($bits=2048)

To specify the sig algorithm use: signCSR($signatureAlgorithm = 'sha1WithRSAEncryption')

Use one of the following supported algorithms:

  • md2WithRSAEncryption
  • md5WithRSAEncryption
  • sha1WithRSAEncryption
  • sha224WithRSAEncryption
  • sha256WithRSAEncryption
  • sha384WithRSAEncryption
  • sha512WithRSAEncryption

Upvotes: 1

Related Questions