getRawPwd: Get ACC password (in raw) from the acckey.pem file

Description Usage Arguments Value Author(s) See Also Examples

Description

If the acckey.pem file already exists, it extracts the cipher text from it and decrypt it into key string. Otherwise, it will call inputPwd to enter the password.
Note that this function returns an encrypted raw vector which needs to be decrypted using decrypt_it().

Usage

1
2
3
getRawPwd(pem = "acckey", overide = FALSE)

get_raw_pwd(pem = "acckey", overide = FALSE)

Arguments

pem

character, the name of the .pem file. Default 'acckey'.

overide

logical, if overide existing acckey.pem and input password again. Default FALSE.

Value

invisible (an encrypted raw vector)

Author(s)

Yiying Wang, wangy@aetna.com

See Also

inputPwd decrypt_it

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
qry_acc <- function(dbname, query) {
    con <- DBI::dbConnect(odbc::odbc(), .connection_string=paste0(
        "Driver={Microsfot Access Driver (*.mdb, *.accdb)};",
        "Dbq=", dbname, ";uid=;pwd=", decrypt_it(get_raw_pwd())))
    return(DBI::dbGetQuery(con, query))
}
qry_acc("testdb.accdb", query="select * from table1")

## End(Not run)

madlogos/aseskit documentation built on June 26, 2019, 12:17 a.m.