@@ -16,7 +16,7 @@ class KeyApi : IKeyApi
1616 public class KeyInfo : IKey
1717 {
1818 /// <inheritdoc />
19- public MultiHash Id { get ; set ; }
19+ public Cid Id { get ; set ; }
2020
2121 /// <inheritdoc />
2222 public string Name { get ; set ; }
@@ -37,22 +37,22 @@ internal KeyApi(IpfsClient ipfs)
3737
3838 public async Task < IKey > CreateAsync ( string name , string keyType , int size , CancellationToken cancel = default ( CancellationToken ) )
3939 {
40- var json = await ipfs . DoCommandAsync ( "key/gen" , cancel , name , $ "type={ keyType } ", $ "size={ size } ", "ipns-base=base32 " ) ;
40+ var json = await ipfs . DoCommandAsync ( "key/gen" , cancel , name , $ "type={ keyType } ", $ "size={ size } ", "ipns-base=base36 " ) ;
4141 var jobject = JObject . Parse ( json ) ;
4242
4343 string id = ( string ) jobject [ "Id" ] ;
4444 string apiName = ( string ) jobject [ "Name" ] ;
4545
4646 return new KeyInfo
4747 {
48- Id = Cid . Decode ( id ) . Hash ,
48+ Id = id ,
4949 Name = apiName
5050 } ;
5151 }
5252
5353 public async Task < IEnumerable < IKey > > ListAsync ( CancellationToken cancel = default ( CancellationToken ) )
5454 {
55- var json = await ipfs . DoCommandAsync ( "key/list" , cancel , null , "l=true" , "ipns-base=base32 " ) ;
55+ var json = await ipfs . DoCommandAsync ( "key/list" , cancel , null , "l=true" , "ipns-base=base36 " ) ;
5656 var keys = ( JArray ) ( JObject . Parse ( json ) [ "Keys" ] ) ;
5757
5858 return keys
@@ -63,15 +63,15 @@ internal KeyApi(IpfsClient ipfs)
6363
6464 return new KeyInfo
6565 {
66- Id = Cid . Decode ( id ) . Hash ,
66+ Id = id ,
6767 Name = name
6868 } ;
6969 } ) ;
7070 }
7171
7272 public async Task < IKey > RemoveAsync ( string name , CancellationToken cancel = default ( CancellationToken ) )
7373 {
74- var json = await ipfs . DoCommandAsync ( "key/rm" , cancel , name , "ipns-base=base32 " ) ;
74+ var json = await ipfs . DoCommandAsync ( "key/rm" , cancel , name , "ipns-base=base36 " ) ;
7575 var keys = JObject . Parse ( json ) [ "Keys" ] as JArray ;
7676
7777 return keys ?
@@ -82,7 +82,7 @@ internal KeyApi(IpfsClient ipfs)
8282
8383 return new KeyInfo
8484 {
85- Id = Cid . Decode ( id ) . Hash ,
85+ Id = id ,
8686 Name = keyName
8787 } ;
8888 } )
@@ -91,15 +91,15 @@ internal KeyApi(IpfsClient ipfs)
9191
9292 public async Task < IKey > RenameAsync ( string oldName , string newName , CancellationToken cancel = default ( CancellationToken ) )
9393 {
94- var json = await ipfs . DoCommandAsync ( "key/rename" , cancel , oldName , $ "arg={ newName } ", "ipns-base=base32 " ) ;
94+ var json = await ipfs . DoCommandAsync ( "key/rename" , cancel , oldName , $ "arg={ newName } ", "ipns-base=base36 " ) ;
9595 var jobject = JObject . Parse ( json ) ;
9696
9797 string id = ( string ) jobject [ "Id" ] ;
9898 string currentName = ( string ) jobject [ "Now" ] ;
9999
100100 return new KeyInfo
101101 {
102- Id = Cid . Decode ( id ) . Hash ,
102+ Id = id ,
103103 Name = currentName
104104 } ;
105105 }
0 commit comments