wahern / luaossl

Most comprehensive OpenSSL module in the Lua universe.
http://25thandclement.com/~william/projects/luaossl.html
Other
142 stars 48 forks source link

what should I do when i want get "DER" format pkey #119

Closed zhixiongdu027 closed 6 years ago

zhixiongdu027 commented 6 years ago

I can get an "PEM" format pkey by use pkey:toPEM() . but when I want "DER" fromat string , there is no pkey:toDER() api.

someone can help ,thanks very mutch .

daurnimator commented 6 years ago

PEM is just a base-64 encoded version of DER (with header/footer). For now, if you want a DER string, you could use :toPEM() and then decode the base64. It seems like a reasonable feature request to add a :toDER() though.

daurnimator commented 6 years ago

Why close the issue? It's a reasonable feature request.

zhixiongdu027 commented 6 years ago

Sorry, I did an inappropriate operation

daurnimator commented 6 years ago

Btw, this seems related to #122: Some objects have :tostring("PEM") and :tostring("DER") as well as a :toPEM(options) However my solution over there was to add :toPEM() for all objects.