diff --git a/docs/resources/key_rsa.md.erb b/docs/resources/key_rsa.md.erb index fdf590db9..af80308f9 100644 --- a/docs/resources/key_rsa.md.erb +++ b/docs/resources/key_rsa.md.erb @@ -1,5 +1,6 @@ --- title: The key_rsa Resource +os: Linux --- # key_rsa @@ -31,13 +32,11 @@ You can use an optional passphrase with `key_rsa` ## Supported Properties -### public? + * `public_key`, `private_key`, `key_length` -To verify if a key is public use the following: +
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do - it { should be_public } - end +## Property Examples ### public_key (String) @@ -47,15 +46,6 @@ The `public_key` property returns the public part of the RSA key pair its('public_key') { should match "-----BEGIN PUBLIC KEY-----\n3597459df9f3982......" } end -### private? - -This property verifies that the key includes a private key: - - describe key_rsa('/etc/pki/www.mywebsite.com.key') do - it { should be_private } - end - - ### private_key (String) The `private_key` property returns the private key or the RSA key pair. @@ -71,3 +61,23 @@ The `key_length` property allows testing the number of bits in the key pair. describe key_rsa('/etc/pki/www.mywebsite.com.key') do its('key_length') { should eq 2048 } end + +## Matchers + +For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/). + +### public? + +To verify if a key is public use the following: + + describe key_rsa('/etc/pki/www.mywebsite.com.key') do + it { should be_public } + end + +### private? + +This property verifies that the key includes a private key: + + describe key_rsa('/etc/pki/www.mywebsite.com.key') do + it { should be_private } + end \ No newline at end of file