import { SignatureScheme } from './SignatureScheme' ; /**
 * Type of key. ECDSA is the default one to use.
 */ export class KeyType { static values : KeyType [ ] = [ ] ; static ECDSA = new KeyType ( 'ECDSA' , 0x12 , SignatureScheme . ECDSAwithSHA256 ) ; static SM2 = new KeyType ( 'SM2' , 0x13 , SignatureScheme . SM2withSM3 ) ; static EDDSA = new KeyType ( 'EDDSA' , 0x14 , SignatureScheme . EDDSAwithSHA512 ) ; param hex static fromHex ( hex ) { const item = KeyType . values . find ( ( v ) => v . hex === hex ) ; if ( item === undefined ) { throw new Error ( 'Enum value not found' ) ; } return item ; } param label static fromLabel ( label ) { const item = KeyType . values . find ( ( v ) => v . label === label ) ; if ( item === undefined ) { throw new Error ( 'Enum value not found' ) ; } return item ; } label : string ; hex : number ; defaultSchema : SignatureScheme ; constructor ( label , hex , defaultSchema ) { this . label = label ; this . hex = hex ; this . defaultSchema = defaultSchema ; KeyType . values . push ( this ) ; } }