pub fn into_keypair(self) -> io::Result<Keypair> {
		use NodeKeyConfig::*;
		match self {
			Secp256k1(Secret::New) =>
				Ok(Keypair::generate_secp256k1()),

			Secp256k1(Secret::Input(k)) =>
				Ok(Keypair::Secp256k1(k.into())),

			Secp256k1(Secret::File(f)) =>
				get_secret(f,
					|mut b| secp256k1::SecretKey::from_bytes(&mut b),
					secp256k1::SecretKey::generate)
				.map(secp256k1::Keypair::from)
				.map(Keypair::Secp256k1),

			Ed25519(Secret::New) =>
				Ok(Keypair::generate_ed25519()),

			Ed25519(Secret::Input(k)) =>
				Ok(Keypair::Ed25519(k.into())),

			Ed25519(Secret::File(f)) =>
				get_secret(f,
					|mut b| ed25519::SecretKey::from_bytes(&mut b),
					ed25519::SecretKey::generate)
				.map(ed25519::Keypair::from)
				.map(Keypair::Ed25519),
		}
	}
/// Evaluate a `NodeKeyConfig` to obtain an identity `Keypair`:
///
///  * If the secret is configured as input, the corresponding keypair is returned.
///
///  * If the secret is configured as a file, it is read from that file, if it exists.
///    Otherwise a new secret is generated and stored. In either case, the
///    keypair obtained from the secret is returned.
///
///  * If the secret is configured to be new, it is generated and the corresponding
///    keypair is returned.
Evaluate a `NodeKeyConfig` to obtain an identity `Keypair`:
If the secret is configured as input, the corresponding keypair is returned.

If the secret is configured as a file, it is read from that file, if it exists.
Otherwise a new secret is generated and stored. In either case, the
keypair obtained from the secret is returned.

If the secret is configured to be new, it is generated and the corresponding
keypair is returned.
Evaluate a ` NodeKeyConfig ` to obtain an identity ` Keypair ` : If the secret is configured as input the corresponding keypair is returned . If the secret is configured as a file it is read from that file if it exists . Otherwise a new secret is generated and stored . In either case the keypair obtained from the secret is returned . If the secret is configured to be new it is generated and the corresponding keypair is returned .
pub fn into_keypair(self) -> io::Result<Keypair> {
		use NodeKeyConfig::*;
		match self {
			Secp256k1(Secret::New) =>
				Ok(Keypair::generate_secp256k1()),
			Secp256k1(Secret::Input(k)) =>
				Ok(Keypair::Secp256k1(k.into())),
			Secp256k1(Secret::File(f)) =>
				get_secret(f,
					|mut b| secp256k1::SecretKey::from_bytes(&mut b),
					secp256k1::SecretKey::generate)
				.map(secp256k1::Keypair::from)
				.map(Keypair::Secp256k1),
			Ed25519(Secret::New) =>
				Ok(Keypair::generate_ed25519()),
			Ed25519(Secret::Input(k)) =>
				Ok(Keypair::Ed25519(k.into())),
			Ed25519(Secret::File(f)) =>
				get_secret(f,
					|mut b| ed25519::SecretKey::from_bytes(&mut b),
					ed25519::SecretKey::generate)
				.map(ed25519::Keypair::from)
				.map(Keypair::Ed25519),
		}
	}
pub fn into_keypair ( self ) -> io :: Result < Keypair > { use NodeKeyConfig :: * ; match self { Secp256k1 ( Secret :: New ) => Ok ( Keypair :: generate_secp256k1 ( ) ) , Secp256k1 ( Secret :: Input ( k ) ) => Ok ( Keypair :: Secp256k1 ( k . into ( ) ) ) , Secp256k1 ( Secret :: File ( f ) ) => get_secret ( f , | mut b | secp256k1 :: SecretKey :: from_bytes ( & mut b ) , secp256k1 :: SecretKey :: generate ) . map ( secp256k1 :: Keypair :: from ) . map ( Keypair :: Secp256k1 ) , Ed25519 ( Secret :: New ) => Ok ( Keypair :: generate_ed25519 ( ) ) , Ed25519 ( Secret :: Input ( k ) ) => Ok ( Keypair :: Ed25519 ( k . into ( ) ) ) , Ed25519 ( Secret :: File ( f ) ) => get_secret ( f , | mut b | ed25519 :: SecretKey :: from_bytes ( & mut b ) , ed25519 :: SecretKey :: generate ) . map ( ed25519 :: Keypair :: from ) . map ( Keypair :: Ed25519 ) , } }
Evaluate a `NodeKeyConfig` to obtain an identity `Keypair`:
 If the secret is configured as input, the corresponding keypair is returned.
Evaluate a ` NodeKeyConfig ` to obtain an identity ` Keypair ` : If the secret is configured as input the corresponding keypair is returned .
self
self