code: protected Key getKeyByType(KeyType type) {
  		switch (type) {
  		case PrivateKey:
  			if (null == this.privateKey) {
  				throw new NullPointerException("Private key must not null when use it !");
  			}
  			return this.privateKey;
  		case PublicKey:
  			if (null == this.publicKey) {
  				throw new NullPointerException("Public key must not null when use it !");
  			}
  			return this.publicKey;
  		}
  		throw new CryptoException("Uknown key type: " + type);
  	}
docs: 根据密钥类型获得相应密钥
  
  @param type 类型 {@link KeyType}
  @return {@link Key}