Skip to content

iamcxa/secure-env-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

secure-env-poc

驗證前後端加解密套件用測試專案。

Getting Started

Enviorment

.Net Core 2.1
https://dotnet.microsoft.com/download/dotnet-core/2.1

Build based on aspnetcore-Vue-starter

Running the tests

Windows環境下可使用已封裝好的exe執行或是使用以下指令:

# Installation
$ npm install

# Compile
$ dotnet build

# 啟動(Start)
$ dotnet run
or
$ npm run

啟動後即可瀏覽 http://localhost:5000進入測試頁面。

PS: 如果遇到localhost憑證不相容的情形, 可以執行以下指令:

$ dotnet dotnet dev-certs https --trust

Ref: MSDN - 信任.NET Core HTTPS 開發憑證

Usage

後端API範例測試:

  1. 直接使用測試頁面操作。
  2. 內有提供Swagger介面供直接操作。

API

// Init with RSA-1024 public key API
const connection = await Connection.getInstance(url);

// Base get/delete
const userData = await connection.get(url);

// post/put with partial encryption
let postBody = { Account: 'test' ,Password: 'test' };
let postOption = { encrypt: ['Password'] }; //option style same as axios
const response = await connection.post(url, postBody, postOption);

//ppost/put with fully encryption
let postBody = { Account: 'test' ,Password: 'test' };
let postOption = { encrypt: 'all' };  //option style same as axios
const response = await connection.post(url, postBody, postOption);

Build with

npm .Net Core 2.1

References

axios - 0.18.0
cryptico-js - 1.1.0

License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published