public void EmptyPemShouldReturnEmptyByteArray() { var pem = ""; var result = PemDecoder.DecodeSection(pem, "Bar"); result.Length.Should().Be(0); }
public void PemWithoutMatchingSectionShouldReturnEmptyByteArray() { var pem = @"-----BEGIN Foo----- data... -----END Foo-----"; var result = PemDecoder.DecodeSection(pem, "Bar"); result.Length.Should().Be(0); }
public void PemWithSingleSectionThatMatchesShouldReturnDecodedData() { var pem = @"-----BEGIN Foo----- QmFy -----END Foo-----"; var result = PemDecoder.DecodeSection(pem, "Foo"); result.Length.Should().Be(3); Encoding.UTF8.GetString(result).Should().Be("Bar"); }