1 files changed, 15 insertions, 4 deletions
diff --git a/crypto/src/asn1/DerOutputStream.cs b/crypto/src/asn1/DerOutputStream.cs
index c03d9dc11..69d5d5f28 100644
--- a/crypto/src/asn1/DerOutputStream.cs
+++ b/crypto/src/asn1/DerOutputStream.cs
@@ -19,7 +19,7 @@ namespace Org.BouncyCastle.Asn1
if (length > 127)
{
int size = 1;
- uint val = (uint) length;
+ uint val = (uint)length;
while ((val >>= 8) != 0)
{
@@ -43,18 +43,29 @@ namespace Org.BouncyCastle.Asn1
int tag,
byte[] bytes)
{
- WriteByte((byte) tag);
+ WriteByte((byte)tag);
WriteLength(bytes.Length);
Write(bytes, 0, bytes.Length);
}
- internal void WriteEncoded(
+ internal void WriteEncoded(
+ int tag,
+ byte first,
+ byte[] bytes)
+ {
+ WriteByte((byte)tag);
+ WriteLength(bytes.Length + 1);
+ WriteByte(first);
+ Write(bytes, 0, bytes.Length);
+ }
+
+ internal void WriteEncoded(
int tag,
byte[] bytes,
int offset,
int length)
{
- WriteByte((byte) tag);
+ WriteByte((byte)tag);
WriteLength(length);
Write(bytes, offset, length);
}
|