Closed FelizQ closed 6 years ago
@FelizQ
I think you need to specify the key_type
?
Like: https://github.com/doujiang24/lua-resty-rsa/blob/master/t/rsa.t#L722
I had tried both of the key types and the result is the same
@FelizQ
Interesting. The bad end line
error means the ending of the public key input is not correct. Have you verified the public key with OpenSSL commandline tool? Could you provide a reproduce case so that I could test by myself?
@spacewander
I had found the cause : the pub key string had been quoted by an interface :(
thanks for your help
I use a multiline string to init a new pubkey and got 'bad end line ' ERR . example:
pubkey = [[-----BEGIN PUBLIC KEY----- asdfasdfasdfasdfasdfasdfasdfasdfas gafasdfasdfasdfasdfasdfasdf dfasdfasdfasdfas fasdfasdfasdfasdfas -----END PUBLIC KEY-----]]
pub , err = rsa:new({public_key = pubkey})
then pub is nil , err is 'bad end line'
does the opt value require specific format ? thanks a lot