https://github.com/gitjournal/openssh_ed25519
Serialize an ed25519 key into the openssh format
https://github.com/gitjournal/openssh_ed25519
Last synced: about 1 year ago
JSON representation
Serialize an ed25519 key into the openssh format
- Host: GitHub
- URL: https://github.com/gitjournal/openssh_ed25519
- Owner: GitJournal
- License: apache-2.0
- Created: 2022-06-27T08:43:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T10:20:29.000Z (about 4 years ago)
- Last Synced: 2025-01-02T04:14:36.839Z (over 1 year ago)
- Language: Dart
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Dart Package for serializing ed25519 keys into the openssh format
## Usage
```dart
import 'dart:io';
import 'package:cryptography/cryptography.dart';
import 'package:openssh_ed25519/openssh_ed25519.dart';
Future main() async {
final keyPair = await Ed25519().newKeyPair();
var privateBytes = await keyPair.extractPrivateKeyBytes();
var public = await keyPair.extractPublicKey();
var publicBytes = public.bytes;
var publicStr = encodeEd25519Public(publicBytes);
var privateStr = encodeEd25519Private(
privateBytes: privateBytes,
publicBytes: publicBytes,
);
await File('id_ed25519.pub').writeAsString(publicStr);
await File('id_ed25519').writeAsString(privateStr);
}
```