Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

System keyring integration for apk signing #201

Description

@naufraghi

I have seen that there is some integration only with the Os X keyring, perhaps using a library can help a lot.
Using Scala + sbt to write seamlessly integrated OSX Apps has a section explaining the use of the Netbeans keyring module (cited from the site):

It consists of two parts: A platform-independent API and implementations of this API for all major operating systems. Currently there are implementations for OSX, Windows, KDE, Gnome, SPI and a fallback using a Java keystore. We start by adding all of that to our build.sbt:

libraryDependencies ++= Seq(
  "org.netbeans.api" % "org-netbeans-modules-keyring" % "RELEASE721",
  "org.netbeans.modules" % "org-netbeans-modules-keyring-impl" % "RELEASE721"
)

resolvers += "netbeans" at "http://bits.netbeans.org/maven2/"

Usage is straightforward, once you know that the keyring only stores char arrays:

private val keyName = "doctivity"

def readToken =
   Keyring.read(keyName) match {
      case null  => None
      case chars => Some(chars.mkString)
   }

 def storeToken(token: String) {
   Keyring.save(keyName, token.toCharArray, "access token for doctivity")
 }

 def deleteToken {
   Keyring.delete(keyName)
 }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions