Giter VIP home page Giter VIP logo

credentialstorageserviceclient's Introduction

#Status Build Status Coverage Status Download Javadoc

CredentialStorageServiceClient

Java client for credential storage service. This project can be used as a stand-alone shell client or as a client library.

Setup

The client requires both private and public keys in a DER format.

$ openssl pkcs8 -topk8 -inform PEM -outform DER -in id_rsa -nocrypt > private_key.der
$ openssl rsa -in id_rsa -out public_key.der -outform DER -pubout

The private key is never sent to the server, only the public key. The private key is only used to decrypt the incoming data.

Stand-alone client

To use the client as a shell stand-alone client, you will need to build the project and use the runnable jar file.

It takes the following arguments:

usage:   --delete | --get | --update | --upload  [-p <arg>] -priv <arg>
       -pub <arg> [-s <arg>] -u <arg>
Credential service client

    --delete             Delete credentials
    --get                Retrieves credentials
 -p,--primary <arg>      Primary credential
 -priv,--private <arg>   Private key file
 -pub,--public <arg>     Public key file
 -s,--secondary <arg>    Secondary credential
 -u,--url <arg>          Credential service URL
    --update             Update existing credentials
    --upload             Upload new credentials

Please report issues at
https://github.com/mtakaki/CredentialStorageService/issues

Get credentials

$ java -jar target/credential-storage-client-0.0.1-SNAPSHOT.jar --get --priv src/test/resources/private_key.der --pub src/test/resources/public_key.der -u https://damp-sea-57022.herokuapp.com/ | jq .
{
  "primary": "test user",
  "secondary": "青"
}

Upload credentials

$ java -jar target/credential-storage-client-0.0.1-SNAPSHOT.jar --priv src/test/resources/private_key.der --pub src/test/resources/public_key.der -u https://damp-sea-57022.herokuapp.com/ --upload --primary "test user" --secondary "青"
Credential successfully uploaded!

If upload is used with an existing credential it will completely override the existing one and regenerate a new symmetrical key.

Update credentials

$ java -jar target/credential-storage-client-0.0.1-SNAPSHOT.jar --priv src/test/resources/private_key.der --pub src/test/resources/public_key.der -u https://damp-sea-57022.herokuapp.com/ --update --primary "user"
Credential successfully updated!

Update supports partial updates, so it preserves the existing information. The symmetrical key is regenerated nonetheless.

Delete credentials

$ java -jar target/credential-storage-client-0.0.1-SNAPSHOT.jar --priv src/test/resources/private_key.der --pub src/test/resources/public_key.der -u https://damp-sea-57022.herokuapp.com/ --delete
Credential successfully deleted!

credentialstorageserviceclient's People

Contributors

mtakaki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.