-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from i2p/generateKeys
fix public key out put in generateKeys
- Loading branch information
Showing
5 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
*.o | ||
libsam3-tests | ||
*.a | ||
*.a | ||
examples/libsam3 | ||
examples/sam3/dgrams | ||
examples/sam3/dgramc | ||
examples/sam3/keys | ||
examples/sam3/keysp | ||
examples/sam3namelookup | ||
examples/sam3/streamss | ||
examples/sam3/streamcs | ||
examples/sam3/log | ||
examples/sam3/err | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//#include <string> | ||
//#include <iostream> | ||
#include "../libsam3/libsam3.h" | ||
#include <stdio.h> | ||
|
||
int main() { | ||
// The session is only usef for transporting the data | ||
Sam3Session ss; | ||
|
||
if (0 > sam3GenerateKeys(&ss, SAM3_HOST_DEFAULT, SAM3_PORT_DEFAULT, 4)) { | ||
printf("got error"); | ||
return -1; | ||
} | ||
printf("\tpubkey: %s \n \tprivkey: %s", ss.pubkey, ss.privkey); | ||
/*auto pub = std::string(ss.pubkey); | ||
auto priv = std::string(ss.privkey); | ||
std::cout << "pub " << pub << std::endl << "priv " << priv << std::endl;*/ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <string> | ||
#include <iostream> | ||
#include <stdio.h> | ||
#include "../libsam3/libsam3.h" | ||
|
||
int main() { | ||
// The session is only usef for transporting the data | ||
Sam3Session ss; | ||
|
||
if (0 > sam3GenerateKeys(&ss, SAM3_HOST_DEFAULT, SAM3_PORT_DEFAULT, Sam3SigType::EdDSA_SHA512_Ed25519)) { | ||
printf("got error"); | ||
return -1; | ||
} | ||
auto pub = std::string(ss.pubkey); | ||
auto priv = std::string(ss.privkey); | ||
|
||
std::cout << "pub " << pub << std::endl << "priv " << priv << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters