#' @export
#' @rdname write_pem
#' @param pubkey a public key
#' @examples # Generate RSA keypair
#' key <- rsa_keygen()
#' pubkey <- key$pubkey
#'
#' # Write to output formats
#' write_ssh(pubkey)
#' write_pem(pubkey)
#' write_pem(key, password = "super secret")
write_ssh <- function(pubkey, path = NULL){
if(inherits(pubkey, "key"))
pubkey <- derive_pubkey(pubkey)
if(!inherits(pubkey, "pubkey"))
stop("Invalid pubkey file.")
str <- as.list(pubkey)$ssh
if(is.null(path)) return(str)
writeLines(str, path)
invisible(path)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.