mirror of
				https://github.com/CorentinTh/it-tools.git
				synced 2025-10-31 12:03:48 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			renovate/n
			...
			ed25519-ke
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 55d2a4d7af | 
| @@ -0,0 +1,14 @@ | |||||||
|  | import { pki } from 'node-forge'; | ||||||
|  |  | ||||||
|  | export { generateKeyPair }; | ||||||
|  |  | ||||||
|  | function generateKeyPair() { | ||||||
|  |   const { privateKey, publicKey } = pki.ed25519.generateKeyPair(); | ||||||
|  |  | ||||||
|  |   console.log({ privateKey, publicKey }); | ||||||
|  |  | ||||||
|  |   return { | ||||||
|  |     publicKeyPem: pki.publicKeyToPem(publicKey), | ||||||
|  |     privateKeyPem: pki.privateKeyToPem(privateKey), | ||||||
|  |   }; | ||||||
|  | } | ||||||
| @@ -0,0 +1,24 @@ | |||||||
|  | <template> | ||||||
|  |   <div> | ||||||
|  |     <h3>Public key</h3> | ||||||
|  |     <textarea-copyable :value="certs.publicKeyPem" /> | ||||||
|  |   </div> | ||||||
|  |  | ||||||
|  |   <div> | ||||||
|  |     <h3>Private key</h3> | ||||||
|  |     <textarea-copyable :value="certs.privateKeyPem" /> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script setup lang="ts"> | ||||||
|  | import TextareaCopyable from '@/components/TextareaCopyable.vue'; | ||||||
|  | import { withDefaultOnErrorAsync } from '@/utils/defaults'; | ||||||
|  | import { computed } from 'vue'; | ||||||
|  | import { generateKeyPair } from './ed25519-key-pair-generator.service'; | ||||||
|  |  | ||||||
|  | const emptyCerts = { publicKeyPem: '', privateKeyPem: '' }; | ||||||
|  |  | ||||||
|  | const certs = computed(() => generateKeyPair()); | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="less" scoped></style> | ||||||
							
								
								
									
										11
									
								
								src/tools/ed25519-key-pair-generator/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/tools/ed25519-key-pair-generator/index.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | import { ArrowsShuffle } from '@vicons/tabler'; | ||||||
|  | import { defineTool } from '../tool'; | ||||||
|  |  | ||||||
|  | export const tool = defineTool({ | ||||||
|  |   name: 'Ed25519 key pair generator', | ||||||
|  |   path: '/ed25519-key-pair-generator', | ||||||
|  |   description: '', | ||||||
|  |   keywords: ['ed25519', 'key', 'pair', 'generator'], | ||||||
|  |   component: () => import('./ed25519-key-pair-generator.vue'), | ||||||
|  |   icon: ArrowsShuffle, | ||||||
|  | }); | ||||||
		Reference in New Issue
	
	Block a user