package exchange

import (
	

	
)

// PublicKey is a public Telegram server key.
type PublicKey struct {
	// RSA public key.
	RSA *rsa.PublicKey
}

// Zero denotes that current PublicKey is zero value.
func ( PublicKey) () bool {
	return .RSA == nil
}

// Fingerprint computes key fingerprint.
func ( PublicKey) () int64 {
	return crypto.RSAFingerprint(.RSA)
}

// PrivateKey is a private Telegram server key.
type PrivateKey struct {
	// RSA private key.
	RSA *rsa.PrivateKey
}

// Zero denotes that current PublicKey is zero value.
func ( PrivateKey) () bool {
	return .RSA == nil
}

// Fingerprint computes key fingerprint.
func ( PrivateKey) () int64 {
	return crypto.RSAFingerprint(&.RSA.PublicKey)
}

// Public returns PublicKey of this PrivateKey pair.
func ( PrivateKey) () PublicKey {
	return PublicKey{
		RSA: &.RSA.PublicKey,
	}
}