Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (100 sloc) 4.8 KB
<!DOCTYPE html>
<head>
<script src="forge/util.js" type="text/javascript"></script>
<script src="forge/oids.js" type="text/javascript"></script>
<script src="forge/asn1.js" type="text/javascript"></script>
<script src="forge/jsbn.js" type="text/javascript"></script>
<script src="forge/rsa.js" type="text/javascript"></script>
<script src="forge/sha1.js" type="text/javascript"></script>
<script src="forge/md5.js" type="text/javascript"></script>
<script src="forge/aes.js" type="text/javascript"></script>
<script src="forge/des.js" type="text/javascript"></script>
<script src="forge/hmac.js" type="text/javascript"></script>
<script src="forge/pbkdf2.js" type="text/javascript"></script>
<script src="forge/pki.js" type="text/javascript"></script>
<script src="lib/jquery-1.7.2.js" type="text/javascript"></script>
<script src="buffer.js" type="text/javascript"></script>
<script src="public_key.js" type="text/javascript"></script>
<script src="private_key.js" type="text/javascript"></script>
<script src="auth_request.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var private_key = octokey.privateKey($('#privatekey').val());
private_key.setPassphrase($('#passphrase').val());
$('#publickey').val(private_key.publicKey().toBase64());
var auth_request = octokey.authRequest({
challenge: $('#challenge').val(),
request_url: $('#request_url').val(),
username: $('#username').val()
});
auth_request.sign(private_key);
$('#authrequest').val(auth_request.toBase64());
});
</script>
<style type="text/css">
textarea { width: 600px; height: 150px; }
input[type=text] { width: 600px; }
</style>
</head>
<body>
<h1>SSH pubkey authentication test</h1>
<form>
<p>
<label for="username">Username (UTF-8):</label><br>
<input type="text" id="username" name="username" value="foo">
</p>
<p>
<label for="challenge">Challenge (base64):</label><br>
<input type="text" id="challenge" name="challenge" value="KWm5PMQC3UYSFY/xgLimHvLhLcuIdwRZoDm4UfEADO0=">
</p>
<p>
<label for="request_url">Request URL:</label><br>
<input type="text" id="request_url" name="request_url" value="https://www.example.com/login">
</p>
<p>
<label for="privatekey">Private key (PEM):</label><br>
<textarea id="privatekey" name="privatekey">-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4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lOVQBbxUnf7VgbhC1xz
DLZZScLcLIsVPBUzHXPgr5TZLTqjrKFVAGI4C6yMJW7R9r56J4LLgXxAj9Nls93j
CTBZZEoneu6V4tGNNCh8dE9rsXb7Szz9bFZKjhoIbVXEpSbCta0+m0JYsRvMMdMt
bQJtJaJBoY4zaIvI9pweE+3UI7NFXBxG23sZ/NJYnpR/wNoo6Qi1JvWxh+Q1cgoO
+BOBvvhuugCz653K2ETIGqrvWhwSpNGWLfG260+1ia7/cSDljHr6jESRAEaqRqIP
A4ENfGSrzpJJ+6gO08+3lKMwJTGpcbnJxB/dBZzSBZSu86E1/b/Ry9dV9biIhOSU
1HPuXF3ULJJZYzApnTt6AH/vJMncYrV8flB/YfApXoYixaNBKTg0h2K38H5vysti
RPiYIReVWKaSqg7sAJa03SPJx5tbblAmwz4fd4JXmjFpbAuQvSy1cYwfSkjn4Rk4
VVFqtqud9MYzVWLBX1EZ3Nd6nSC9UsVUtza3Wzs5lWgNev/9rzIu99SKPW9nRclM
5eD+BFd+EDtrsjPsjfHFru5B9rJCq9LfKDenghbfTTKoQMYj2y3toNYrcETzMvhv
-----END RSA PRIVATE KEY-----
</textarea>
</p>
<p>
<label for="passphrase">Passphrase:</label><br>
<input type="text" id="passphrase" name="passphrase" value="password">
</p>
<p>
<label for="publickey">Public key (RFC4253):</label><br>
<textarea id="publickey" name="publickey"></textarea>
</p>
<p>
<label for="signature">Authentication request (base64):</label><br>
<textarea id="authrequest" name="authrequest"></textarea>
</p>
</form>
</body>
Something went wrong with that request. Please try again.