c-libp2p/include/libp2p/secio/secio.h

22 lines
709 B
C
Raw Normal View History

2017-02-01 12:52:09 +00:00
#pragma once
#include "libp2p/crypto/key.h"
#include "libp2p/crypto/rsa.h"
#include "libp2p/conn/session.h"
#include "libp2p/peer/peerstore.h"
2017-02-01 12:52:09 +00:00
/**
* Handling of a secure connection
2017-02-01 12:52:09 +00:00
*/
/***
* performs initial communication over an insecure channel to share
* keys, IDs, and initiate connection. This is a framed messaging system
* @param session the secure session to be filled
2017-03-07 00:03:04 +00:00
* @param private_key the local private key to use
* @param remote_requested the other side is who asked for the upgrade
* @returns true(1) on success, false(0) otherwise
*/
int libp2p_secio_handshake(struct SessionContext* session, struct RsaPrivateKey* private_key, struct Peerstore* peerstore, int remote_requested);