diff options
author | william <william@25tandclement.com> | 2014-03-27 23:02:32 -0700 |
---|---|---|
committer | william <william@25tandclement.com> | 2014-03-27 23:02:32 -0700 |
commit | f6a21f8cd2bc3325a81d85ff58611db000a1f491 (patch) | |
tree | 22fef841067bc26a97b7b7064a6d8ccb94970bdd /examples | |
parent | 47532cac8cdd5d697a56445e5946703de13b19d8 (diff) | |
download | luaossl-f6a21f8cd2bc3325a81d85ff58611db000a1f491.tar.gz luaossl-f6a21f8cd2bc3325a81d85ff58611db000a1f491.tar.bz2 luaossl-f6a21f8cd2bc3325a81d85ff58611db000a1f491.zip |
fixup examples/ for pubkey -> pkey changes
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 @@ | |||
7 | -- CSR generation. | 7 | -- CSR generation. |
8 | -- | 8 | -- |
9 | 9 | ||
10 | local pubkey = require"openssl.pubkey" | 10 | local pkey = require"openssl.pkey" |
11 | local x509 = require"openssl.x509" | 11 | local x509 = require"openssl.x509" |
12 | local name = require"openssl.x509.name" | 12 | local name = require"openssl.x509.name" |
13 | local altname = require"openssl.x509.altname" | 13 | local altname = require"openssl.x509.altname" |
14 | 14 | ||
15 | -- generate our public/private key pair | 15 | -- generate our public/private key pair |
16 | --local key = pubkey.new{ type = "RSA", bits = 1024 } | 16 | --local key = pkey.new{ type = "RSA", bits = 1024 } |
17 | --local key = pubkey.new{ type = "DSA", bits = 1024 } | 17 | --local key = pkey.new{ type = "DSA", bits = 1024 } |
18 | local key = pubkey.new{ type = "EC", curve = "prime192v1" } | 18 | local key = pkey.new{ type = "EC", curve = "prime192v1" } |
19 | 19 | ||
20 | -- our Subject and Issuer DN (self-signed, so same) | 20 | -- our Subject and Issuer DN (self-signed, so same) |
21 | local dn = name.new() | 21 | 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 @@ | |||
3 | -- Example public-key signature verification. | 3 | -- Example public-key signature verification. |
4 | -- | 4 | -- |
5 | 5 | ||
6 | local pubkey = require"openssl.pubkey" | 6 | local pkey = require"openssl.pkey" |
7 | local digest = require"openssl.digest" | 7 | local digest = require"openssl.digest" |
8 | 8 | ||
9 | -- generate a public/private key pair | 9 | -- generate a public/private key pair |
10 | local key = pubkey.new{ type = "EC", curve = "prime192v1" } | 10 | local key = pkey.new{ type = "EC", curve = "prime192v1" } |
11 | 11 | ||
12 | -- digest our message using an appropriate digest ("ecdsa-with-SHA1" for EC; | 12 | -- digest our message using an appropriate digest ("ecdsa-with-SHA1" for EC; |
13 | -- "dss1" for DSA; and "sha1", "sha256", etc for RSA). | 13 | -- "dss1" for DSA; and "sha1", "sha256", etc for RSA). |
@@ -19,7 +19,7 @@ local sig = key:sign(data) | |||
19 | 19 | ||
20 | -- to prove verification works, instantiate a new object holding just | 20 | -- to prove verification works, instantiate a new object holding just |
21 | -- the public key | 21 | -- the public key |
22 | local pub = pubkey.new(key:toPEM"public") | 22 | local pub = pkey.new(key:toPEM"public") |
23 | 23 | ||
24 | -- a utility routine to output our signature | 24 | -- a utility routine to output our signature |
25 | local function tohex(b) | 25 | local function tohex(b) |