File tree Expand file tree Collapse file tree 1 file changed +0
-5
lines changed
cryptography-serialization/pem/src/commonMain/kotlin Expand file tree Collapse file tree 1 file changed +0
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ public class PemDocument(
6060 while (startIndex < text.length) {
6161 yield (tryDecodeFromString(text, startIndex) { startIndex = it } ? : break )
6262 }
63- if (startIndex == 0 ) throwPemMissingBeginLabel()
6463 }
6564
6665 @OptIn(UnsafeByteStringApi ::class )
@@ -82,20 +81,16 @@ public class PemDocument(
8281 while (startIndex < bytes.size) {
8382 yield (tryDecodeFromByteString(bytes, startIndex) { startIndex = it } ? : break )
8483 }
85- if (startIndex == 0 ) throwPemMissingBeginLabel()
8684 }
8785
8886 public fun decode (source : Source ): PemDocument {
8987 return tryDecodeFromSource(source) ? : throwPemMissingBeginLabel()
9088 }
9189
9290 public fun decodeToSequence (source : Source ): Sequence <PemDocument > = sequence {
93- var hasAtLeastOneBeginLabel = false
9491 while (! source.exhausted()) {
9592 yield (tryDecodeFromSource(source) ? : break )
96- hasAtLeastOneBeginLabel = true
9793 }
98- if (! hasAtLeastOneBeginLabel) throwPemMissingBeginLabel()
9994 }
10095 }
10196}
You can’t perform that action at this time.
0 commit comments