Struct aws_sdk_ec2::model::KeyPairInfo
source · #[non_exhaustive]pub struct KeyPairInfo { /* private fields */ }
Expand description
Describes a key pair.
Implementations§
source§impl KeyPairInfo
impl KeyPairInfo
sourcepub fn key_pair_id(&self) -> Option<&str>
pub fn key_pair_id(&self) -> Option<&str>
The ID of the key pair.
sourcepub fn key_fingerprint(&self) -> Option<&str>
pub fn key_fingerprint(&self) -> Option<&str>
If you used CreateKeyPair
to create the key pair:
-
For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
-
For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8.
If you used ImportKeyPair
to provide Amazon Web Services the public key:
-
For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC4716.
-
For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8.
Any tags applied to the key pair.
sourcepub fn public_key(&self) -> Option<&str>
pub fn public_key(&self) -> Option<&str>
The public key material.
sourcepub fn create_time(&self) -> Option<&DateTime>
pub fn create_time(&self) -> Option<&DateTime>
If you used Amazon EC2 to create the key pair, this is the date and time when the key was created, in ISO 8601 date-time format, in the UTC time zone.
If you imported an existing key pair to Amazon EC2, this is the date and time the key was imported, in ISO 8601 date-time format, in the UTC time zone.
source§impl KeyPairInfo
impl KeyPairInfo
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture KeyPairInfo
.
Examples found in repository?
47643 47644 47645 47646 47647 47648 47649 47650 47651 47652 47653 47654 47655 47656 47657 47658 47659 47660 47661 47662 47663 47664 47665 47666 47667 47668 47669 47670 47671 47672 47673 47674 47675 47676 47677 47678 47679 47680 47681 47682 47683 47684 47685 47686 47687 47688 47689 47690 47691 47692 47693 47694 47695 47696 47697 47698 47699 47700 47701 47702 47703 47704 47705 47706 47707 47708 47709 47710 47711 47712 47713 47714 47715 47716 47717 47718 47719 47720 47721 47722 47723 47724 47725 47726 47727 47728 47729 47730 47731 47732 47733 47734 47735 47736 47737 47738 47739 47740 47741 47742 47743 47744
pub fn deser_structure_crate_model_key_pair_info(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::KeyPairInfo, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::KeyPairInfo::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("keyPairId") /* KeyPairId com.amazonaws.ec2#KeyPairInfo$KeyPairId */ => {
let var_2179 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_key_pair_id(var_2179);
}
,
s if s.matches("keyFingerprint") /* KeyFingerprint com.amazonaws.ec2#KeyPairInfo$KeyFingerprint */ => {
let var_2180 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_key_fingerprint(var_2180);
}
,
s if s.matches("keyName") /* KeyName com.amazonaws.ec2#KeyPairInfo$KeyName */ => {
let var_2181 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_key_name(var_2181);
}
,
s if s.matches("keyType") /* KeyType com.amazonaws.ec2#KeyPairInfo$KeyType */ => {
let var_2182 =
Some(
Result::<crate::model::KeyType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::KeyType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_key_type(var_2182);
}
,
s if s.matches("tagSet") /* Tags com.amazonaws.ec2#KeyPairInfo$Tags */ => {
let var_2183 =
Some(
crate::xml_deser::deser_list_com_amazonaws_ec2_tag_list(&mut tag)
?
)
;
builder = builder.set_tags(var_2183);
}
,
s if s.matches("publicKey") /* PublicKey com.amazonaws.ec2#KeyPairInfo$PublicKey */ => {
let var_2184 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_public_key(var_2184);
}
,
s if s.matches("createTime") /* CreateTime com.amazonaws.ec2#KeyPairInfo$CreateTime */ => {
let var_2185 =
Some(
aws_smithy_types::DateTime::from_str(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, aws_smithy_types::date_time::Format::DateTime
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
?
)
;
builder = builder.set_create_time(var_2185);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for KeyPairInfo
impl Clone for KeyPairInfo
source§fn clone(&self) -> KeyPairInfo
fn clone(&self) -> KeyPairInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more