diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/self.x509 | 8 | ||||
-rwxr-xr-x | examples/vrfy.sig | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/self.x509 b/examples/self.x509 index 39525d0..31d6058 100755 --- a/examples/self.x509 +++ b/examples/self.x509 @@ -7,15 +7,15 @@ -- CSR generation. -- -local pubkey = require"openssl.pubkey" +local pkey = require"openssl.pkey" local x509 = require"openssl.x509" local name = require"openssl.x509.name" local altname = require"openssl.x509.altname" -- generate our public/private key pair ---local key = pubkey.new{ type = "RSA", bits = 1024 } ---local key = pubkey.new{ type = "DSA", bits = 1024 } -local key = pubkey.new{ type = "EC", curve = "prime192v1" } +--local key = pkey.new{ type = "RSA", bits = 1024 } +--local key = pkey.new{ type = "DSA", bits = 1024 } +local key = pkey.new{ type = "EC", curve = "prime192v1" } -- our Subject and Issuer DN (self-signed, so same) local dn = name.new() diff --git a/examples/vrfy.sig b/examples/vrfy.sig index 94daf43..cf60995 100755 --- a/examples/vrfy.sig +++ b/examples/vrfy.sig @@ -3,11 +3,11 @@ -- Example public-key signature verification. -- -local pubkey = require"openssl.pubkey" +local pkey = require"openssl.pkey" local digest = require"openssl.digest" -- generate a public/private key pair -local key = pubkey.new{ type = "EC", curve = "prime192v1" } +local key = pkey.new{ type = "EC", curve = "prime192v1" } -- digest our message using an appropriate digest ("ecdsa-with-SHA1" for EC; -- "dss1" for DSA; and "sha1", "sha256", etc for RSA). @@ -19,7 +19,7 @@ local sig = key:sign(data) -- to prove verification works, instantiate a new object holding just -- the public key -local pub = pubkey.new(key:toPEM"public") +local pub = pkey.new(key:toPEM"public") -- a utility routine to output our signature local function tohex(b) |