public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (Value != null) { outs.Write(Value); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { int num; if (((Value.Length < 2) || (Value[0] > 2)) || ((Value[0] != 2) && (Value[1] > 0x27))) { throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidObjectIdException); } var len = 1; for (num = 2; num < Value.Length; num++) { len += Asn1RunTime.GetIdentBytesCount(Value[num]); } if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(len); var ident = (Value[0] * 40) + Value[1]; outs.EncodeIdentifier(ident); for (num = 2; num < Value.Length; num++) { outs.EncodeIdentifier(Value[num]); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (((OidValue.Items.Length < 2) || (OidValue.Items[0] > 2)) || ((OidValue.Items[0] != 2) && (OidValue.Items[1] > 0x27))) { throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidObjectIdException); } var len = 1; for (var i = 2; i < OidValue.Items.Length; i++) { len += Asn1RunTime.GetIdentBytesCount(OidValue.Items[i]); } if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(len); var ident = (OidValue.Items[0] * 40) + OidValue.Items[1]; outs.EncodeIdentifier(ident); for (var i = 2; i < OidValue.Items.Length; i++) { outs.EncodeIdentifier(OidValue.Items[i]); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeIntValue(Value, true); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(0); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { foreach (Asn1OpenType type in Value) { if (type != null) { type.Encode(outs, false); } } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(1); outs.WriteByte(Value ? -1 : 0); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (explicitTagging) { outs.EncodeTag(Tag); } var buffer = new Asn1BerEncodeBuffer(); var len = EncodeValue(buffer, _value, true); outs.EncodeLength(len); outs.Write(buffer.MsgCopy); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { try { var bytes = Encoding.UTF8.GetBytes(Value); if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(bytes.Length); outs.Write(bytes); } catch (IOException exception) { Console.Out.WriteLine("This JVM does not support UTF-8 encoding"); Asn1Util.WriteStackTrace(exception, Console.Error); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { var len = 0; foreach (var i in OidValue.Items) { len += Asn1RunTime.GetIdentBytesCount(i); } if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(len); foreach (var i in OidValue.Items) { outs.EncodeIdentifier(i); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { int num; var len = 0; for (num = 0; num < Value.Length; num++) { len += Asn1RunTime.GetIdentBytesCount(Value[num]); } if (explicitTagging) { outs.EncodeTag(Tag); } outs.EncodeLength(len); for (num = 0; num < Value.Length; num++) { outs.EncodeIdentifier(Value[num]); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { outs.EncodeCharString(Value, explicitTagging, Tag); }
public virtual void Encode(Asn1BerOutputStream outs, bool explicitTagging) { }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { Encode(outs, explicitTagging, Tag); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { outs.EncodeUnivString(_value, explicitTagging, Tag); }
public virtual void Encode(Asn1BerOutputStream outs, bool explicitTagging, Asn1Tag tag) { SafeParseString(); outs.EncodeCharString(Value, explicitTagging, tag); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { base.Encode(outs, false); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { outs.EncodeCharString(base.Value, explicitTagging, Tag); }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { if (explicitTagging) { outs.EncodeTag(Tag); } if (Value == 0.0) { outs.EncodeLength(0); } else if (Value == double.NegativeInfinity) { outs.EncodeIntValue(MinusInfinity, true); } else if (Value == double.PositiveInfinity) { outs.EncodeIntValue(PlusInfinity, true); } else { var len = 1; var num2 = BitConverter.DoubleToInt64Bits(Value); var num3 = ((num2 >> RealIso6093Mask) == 0L) ? 1 : -1; var num4 = ((int)((num2 >> 0x34) & 0x7ffL)) - 0x433; var w = (num4 == 0) ? ((num2 & 0xfffffffffffffL) << 1) : ((num2 & 0xfffffffffffffL) | 0x10000000000000L); if (w != 0L) { var bits = TrailingZerosCnt(w); w = Asn1Util.UrShift(w, bits); num4 += bits; len += Asn1Util.GetUlongBytesCount(w); } else { len++; } var num7 = RealBinary; if (num3 == -1) { num7 |= PlusInfinity; } var bytesCount = Asn1Util.GetBytesCount(num4); len += bytesCount; switch (bytesCount) { case RealExplen2: break; case RealExplen3: num7 |= 1; break; case RealExplenLong: num7 |= 2; break; default: num7 |= 3; len++; break; } outs.EncodeLength(len); outs.WriteByte((byte)num7); if ((num7 & 3) == 3) { outs.EncodeIntValue(bytesCount, false); } outs.EncodeIntValue(num4, false); outs.EncodeIntValue(w, false); } }
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging) { outs.EncodeBitString(Value, NumBits, explicitTagging, Tag); }