Class Settings
java.lang.Object
aQute.lib.settings.Settings
Maintains persistent settings for bnd (or other apps). The default is
~/.bnd/settings.json). The settings are normal string properties but it
specially maintains a public/private key pair and it provides a method to
sign a byte array with this pair.
Why not keystore and preferences? Well, keystore is hard to use (you can only
store a private key when you have a certificate, but you cannot create a
certificate without using com.sun classes) and preferences are not editable.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()voidgenerate()voidgenerate(char[] password) getEmail()getName()byte[]Return an encoded private RSA key.byte[]Return an encoded public RSA key.booleanisDirty()booleanisEmpty()keySet()booleanload()booleanload(char[] password) voidvoidsave()voidsave(char[] password) voidvoidsetKeyPair(byte[] id, byte[] secret) voidbyte[]sign(byte[] con) Sign a byte arrayintsize()toString()values()booleanverify(byte[] con) Verify a signed byte arrayMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Settings
public Settings() -
Settings
-
-
Method Details
-
load
public boolean load() -
load
public boolean load(char[] password) -
save
public void save() -
save
public void save(char[] password) -
generate
-
generate
-
getEmail
-
setEmail
-
setKeyPair
-
setName
-
getName
-
getPublicKey
-
getPrivateKey
-
sign
-
verify
-
clear
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,String>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,String>
-
entrySet
-
get
-
isEmpty
-
keySet
-
put
-
putAll
-
remove
-
size
-
values
-
isDirty
public boolean isDirty() -
toString
-