Package net.voidnote
Class VoidNote
java.lang.Object
net.voidnote.VoidNote
Official Java SDK for VoidNote.
Zero-knowledge self-destructing notes and live encrypted streams. The key lives in the link. We never see it.
Requires Java 17+. The only external dependency is Gson for JSON.
// Read a note
ReadResult note = VoidNote.read("https://voidnote.net/note/<token>");
System.out.println(note.content());
// Create a note (destroyed after 1 read)
CreateResult created = VoidNote.create(
"launch codes: 4-8-15-16-23-42",
CreateOptions.of("vn_...").withMaxViews(1));
System.out.println(created.url());
// Live encrypted stream
StreamHandle stream = VoidNote.createStream(StreamOptions.of("vn_..."));
System.out.println("share: " + stream.url);
stream.write("Deployment starting...");
stream.write("All 47 tests passed");
stream.close();
-
Method Summary
Modifier and TypeMethodDescriptionstatic CreateResultcreate(String content, CreateOptions opts) Encryptscontentclient-side and creates a self-destructing note.static StreamHandlecreateStream(StreamOptions opts) Opens a live encrypted stream.static ReadResultFetches and decrypts a VoidNote.static ReadResultLikeread(java.lang.String)but with a custom API base URL (for self-hosted instances).static voidWatches a stream, callingonMessagefor each decrypted event.
-
Method Details
-
read
Fetches and decrypts a VoidNote.- Parameters:
urlOrToken- Full URL (https://voidnote.net/note/<token>) or raw 64-char hex token.- Throws:
VoidNoteException
-
readFrom
Likeread(java.lang.String)but with a custom API base URL (for self-hosted instances).- Throws:
VoidNoteException
-
create
Encryptscontentclient-side and creates a self-destructing note.- Parameters:
content- The secret plaintext to protect.opts- Options including the required API key.- Throws:
VoidNoteException
-
createStream
Opens a live encrypted stream.- Parameters:
opts- Options including the required API key.- Returns:
- A
StreamHandle— sharehandle.urlwith viewers before writing. - Throws:
VoidNoteException
-
watch
Watches a stream, callingonMessagefor each decrypted event. Blocks until the stream is closed. Auto-reconnects on drop.- Parameters:
urlOrToken- Full stream URL or raw 64-char hex token.onMessage- Called with decrypted plaintext for each incoming message.- Throws:
VoidNoteException
-