Peke ki te ihirangi

Ngā Pātaka Kiritaki

Ko te kiritaki ōkawa ko onetime-ruby, e tautoko ana i te API v1 me te v2, i ngā rohe ipurangi ā-rohe katoa, me ngā URL pūtake ritenga.

Ko ērā atu mea katoa i tēnei whārangi e tiakina ana e te hapori. Nō mua i te API v2 me ngā rohe ipurangi ā-rohe te nuinga o ēnei pātaka, nō reira ka karanga rātou i te nuinga o te wā i ngā pito mutunga v1 kua whakamutua ki onetimesecret.com — tirohia te tuhipoka tūnga o ia urunga, ā, manatokona kia mahi te pātaka ki tō rohe, ki tō taupānga manaaki-ā-kiri rānei, i mua i te whakawhirinaki ki a ia.

Reo Pātaka Mahi whakamutunga¹ Rohe ipurangi ā-rohe / ritenga
Ruby onetime-ruby (ōkawa) 2026-06 ✅ ngā rohe katoa + URL pūtake ritenga
Go go-onetimesecret 2026-05 kaihautū US
Python onetimesecret-cli 2024-11 kōwhiringa rohe US / EU
Go otsgo 2024-03 kāore i tuhia
PowerShell OneTimeSecret 2021-06 URL pūtake ritenga
Bash onetimesecret-bash 2020-05 kaihautū ritenga
Python py_onetimesecret 2019-05 ❌ (wā o Python 2)
C# OneTimeSharp 2018-05 ❌
Java onetime-java 2014-06 URL manaaki-ā-kiri anake
Perl Net::OneTimeSecret 2012-02 ❌

¹ Te tuku, te putanga whakamutunga rānei i te wā o te arotake whakamutunga (2026-07).

Whārangi GitHub - onetime-ruby nā Delano — kiritaki ōkawa, e tiakina hohe ana (tuku whakamutunga 2026-06). Ka tautoko i te API v1 (kua whakamutua) me te v2, i ngā rohe ipurangi ā-rohe, me ngā URL pūtake ritenga. Me whai Ruby 3.1+, kāore he whakawhirinakitanga wā-whakahaere.

require 'onetime/api'
api = Onetime::API.new('YOUR_EMAIL', 'YOUR_OTS_APIKEY')
options = {
secret: 'Jazz, jazz and more jazz.',
recipient: 'example@onetimesecret.com',
ttl: 7200
}
ret = api.post('/share', options)
puts ret['secret_key']

Whārangi GitHub - onetimesecret-cli nā slashpass — e tiakina ana e te hapori (tuku whakamutunga 2024-11). Ka tautoko i tētahi kōwhiringa rohe (us / eu).

from onetimesecret import OneTimeSecretCli
cli = OneTimeSecretCli(ONETIMESECRET_USER, ONETIMESECRET_KEY)
cli.create_link("secret") # return a link like https://onetimesecret.com/secret/xxxxxxxxxxx

Whārangi GitHub - py_onetimesecret nā Vladislav Stepanov — kāore e tiakina ana (tuku whakamutunga 2019; he Python 2 te tauira kei raro). Ka whakamahi i te API v1 kua whakamutua ki onetimesecret.com anake.

from onetimesecret import OneTimeSecret
o = OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY")
secret = o.share(u"test")
print o.retrieve_secret(secret["secret_key"])
# {u'secret_key': u'dtr7ixukiolpx1i4i87kahmhyoy2q65',
# u'value': u'test'}

Net::OneTimeSecret i runga i CPAN nā Kyle Dawkins — kāore e tiakina ana (putanga whakamutunga 0.04, 2012-02). Nō mua i te API v2 me ngā rohe ipurangi ā-rohe.

#!/usr/bin/env perl
use Net::OneTimeSecret;
# Note: replace these with yours in order for this to work!
my $customerId = 'YOUR_EMAIL';
my $testApiKey = 'YOUR_OTS_APIKEY';
my $api = Net::OneTimeSecret->new( $customerId, $testApiKey );
my $result = $api->shareSecret( 'Jazz, jazz and more jazz.',
passphrase => 'thepassword',
recipient => 'kyle@shoffle.com',
ttl => 7200,
);
printf( "%s\n", $result->{secret_key} );
my $secret = $api->retrieveSecret( $result->{secret_key}, passphrase => "thepassword" );
printf( "%s\n", $secret->{value} );

Whārangi GitHub - onetime-java nā Marcin Pawlowski — kāore e tiakina ana (tuku whakamutunga 2014-06). Ka tango i tētahi URL taupānga, nō reira tērā pea ka mahi i te manaaki-ā-kiri, engari nō mua i te API v2.

OneTimeSecret ots = new OneTimeSecretRestImpl(
"https://path/to/ots/instance",
"ots-username",
"ots-apikey");
GenerateResponse generateResponse = ots.generate(
new GenerateRequest.Builder()
.withPassphrase("supersecret")
.build());
RetrieveResponse retrieveResponse = ots.retrieve(
new RetrieveRequest.Builder()
.withSecretKey(generateResponse.getSecretKey())
.withPassphrase("supersecret")
.build());
assertEquals(generateResponse.getValue(), retrieveResponse.getValue());

Whārangi GitHub - OneTimeSharp nā Vladislav Stepanov — kāore e tiakina ana (tuku whakamutunga 2018-05). Ka whakamahi i te API v1 kua whakamutua ki onetimesecret.com anake.

// You can use OneTimeSharp in any of your projects which are compatible with .NET (4.0+) or Mono (2.10.8+).
using VStepanov.OneTimeSharp;
class Test
{
static void Main(string[] args)
{
var ots = new OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY");
var generated = ots.GenerateSecret();
Console.WriteLine(generated.Value); // LR*?us*A(UT*
Console.WriteLine(generated.SecretKey); // ikzx3m77j5by8411cg5lk5fvfylvl0i
Console.WriteLine(ots.GetSecretLink(generated)); // https://onetimesecret.com/secret/ikzx3m77j5by8411cg5lk5fvfylvl0i
var shared = ots.ShareSecret("Hello, OTS!");
Console.WriteLine(shared.MetadataKey); // kd6rgsucl98qbgu9eavjq4k5sdxsom0
Console.WriteLine(ots.GetMetadataLink(shared)); // https://onetimesecret.com/private/kd6rgsucl98qbgu9eavjq4k5sdxsom0
}
}

Whārangi GitHub - go-onetimesecret nā Corbalt — e tiakina ana e te hapori (tuku whakamutunga 2026-05, kua whakahoutia mō te kaihautū us.onetimesecret.com). He CLI kei roto.

import ots "github.com/corbaltcode/go-onetimesecret"
client := ots.Client{
Username: "user@example.com",
Key: "my api key",
}
metadata, err := client.Put("the launch codes", "passphrase", 0, "")
if err != nil {
// handle error
}
secret, err := client.Get(metadata.SecretKey, "passphrase")
if err != nil {
// handle error
}
// prints "the launch codes"
print(secret)
Matapihi pūmanawa
$ go install github.com/corbaltcode/go-onetimesecret/cmd/ots@latest
$ ots put 'what is essential is invisible to the eye'
hdjk6p0ozf61o7n6pbaxy4in8zuq7sm ifipvdpeo8oy6r8ryjbu8y7rhm9kty9
$ ots get hdjk6p0ozf61o7n6pbaxy4in8zuq7sm
what is essential is invisible to the eye
$ ots gen
rVjbS$twCJkS 4nwhy7v4fnabayqc5auv4ogh0nfr20 flsdlaun6hwczqu9utmc0vts5xj9xu1
$ ots burn flsdlaun6hwczqu9utmc0vts5xj9xu1
flsdlaun6hwczqu9utmc0vts5xj9xu1

Whārangi GitHub - otsgo nā Emídio Neto — e tiakina ana e te hapori (putanga whakamutunga v1.1.0, 2024-03). Kāore i tuhia te tautoko rohe ipurangi ā-rohe.

// Build a new client
client := ots.NewClient(
WithUsername("otsuser@domain.com"),
WithApiKey("xxxxxxxx"),
)
// Send a request with context
ctx := context.Background()
response, err := client.GetStatus(ctx)
if err != nil {
panic(err)
}
fmt.Println(response.Status)

Whārangi GitHub - OneTimeSecret nā Craig Gumbley — kāore e tiakina ana (putanga whakamutunga 2021-06). Ka tautoko i tētahi -BaseUrl ritenga, nō reira ka taea te tohu ki tētahi rohe, ki tētahi taupānga manaaki-ā-kiri rānei, engari nō mua i te API v2.

Matapihi pūmanawa
# Install from the PowerShell gallery
Install-Module -Name OneTimeSecret -Scope CurrentUser
# Set connection information
Set-OTSAuthorizationToken -Username user@mail.com -APIKey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Generate a new shared secret
New-OTSSharedSecret -Secret "Very Secret" -Passphrase 1234 -Recipient user@mail.com
# Retrieve a secret
Get-OTSSecret -SecretKey qqevnp70b4uoiax4knzhwlhros6ne7x -Passphrase 1234
# View all functions that are available
Get-Command -Module OneTimeSecret | Select Name

Whārangi GitHub - onetimesecret-bash nā Eric Engstrom — kāore e tiakina ana (tuku whakamutunga 2020-05). Ka tautoko i tētahi kaihautū ritenga mā ots_set_host, engari nō mua i te API v2 me ngā rohe ipurangi ā-rohe.

Matapihi pūmanawa
# source for use anonymously (secrets created anonymously)
source ots.bash
# or, source with specific auth credentials
APIUSER="USERNAME"
APIKEY="APIKEY"
source ots.bash -u $APIUSER -k $APIKEY
# check status of server
ots_status
# create a secret and get back the URL
URL=$(echo "secret" | ots_share)
# share a multi line secret via HEREDOC.
URL=$(ots_share <<-EOF
This is a Secret
... on multiple lines
EOF
)
# pass options to share or generate.
URL=$(ots_share ttl=600 \
passphrase="shared-secret" \
recipient="someone@somewhere.com" <<< "SECRET")
# fetch the secret data
local DATA="$(ots_retrieve "$URL")"
# share/generate a new secret, and get back the private metadata key
local KEY=$(ots_metashare <<< "SECRET")
local KEY=$(ots_metagenerate)
# get a list of private metadata keys recently created.
# note that this requires valid authentication credentials
local -a RECENT=( $(ots_recent) )
# check on the current state of a secret, given the private key
ots_state $KEY
# burn a secret, given the private key
ots_burn $KEY
Matapihi pūmanawa
# Share a secret (from stdin)
./ots share
SECRET
^D
# Share a secret (via HEREDOC)
./ots share <<-EOF
This is a multi-line secret via HEREDOC.
Something else goes here.
EOF
# Get/Retrieve a secret:
./ots get <key|url>
./ots retrieve <key|url>
# Burn a secret, given its private metadata key:
./ots burn <key>