Skip to content

topl-service-base / io.matthewnelson.topl_service_base / BaseV3ClientAuthManager / addV3ClientAuthenticationPrivateKey


@WorkerThread abstract fun addV3ClientAuthenticationPrivateKey(nickname:String, onionAddress:String, base32EncodedPrivateKey:String):File? (source)

Creates a file containing v3 Client Authorization for a Hidden Service in the format of:

  • Filename: nickname.auth_private
  • File Contents: (56-char-onion-addr-without.onion):descriptor:x25519:(x25519 private key in base32)

Exceptions are thrown for you with adequate messages if the values passed are non-compliant.



nickname - The nickname for the file. Is appended with .auth_private and used as the File name nickname requirements are:

onionAddress - The .onion address for which this Private Key will exist for

base32EncodedPrivateKey - The private key for authenticating to the Hidden Service


IllegalArgumentException - If passed arguments are not compliant with the spec

IllegalStateException - If the file already exists (and must be deleted before overwriting), or if a file exists with the same onion address & private key

SecurityException - If access is not authorized

Return The File if it was created properly, null if it was not