tests/testthat/test_cert.R

context("Read certificates")

test_that("Roundtrip pem/der formats", {
  cert <- read_cert("../keys/opencpu.org.cer", der = TRUE)
  expect_equal(cert, read_cert(write_pem(cert)))
  expect_equal(cert, read_cert(write_pem(cert, tempfile())))
  expect_equal(cert, read_cert(write_der(cert), der = TRUE))
  expect_equal(cert, read_cert(write_der(cert, tempfile()), der = TRUE))
})

Try the openssl package in your browser

Any scripts or data that you put into this service are public.

openssl documentation built on Nov. 17, 2017, 7:08 a.m.