GetDerEncoded() 공개 메소드

public GetDerEncoded ( ) : byte[]
리턴 byte[]
예제 #1
0
 private static void WriteEncodable(MemoryStream ms, Asn1Encodable e)
 {
     if (e != null)
     {
         byte[] derEncoded = e.GetDerEncoded();
         ms.Write(derEncoded, 0, derEncoded.Length);
     }
 }
예제 #2
0
        public DerApplicationSpecific(
            int				tag,
            Asn1Encodable	obj)
        {
            this.tag = tag | Asn1Tags.Constructed;

            this.octets = obj.GetDerEncoded();
        }
        public DerApplicationSpecific(
            int tag,
            Asn1Encodable obj)
        {
            this.tag = tag | Asn1Tags.Constructed;

            this.octets = obj.GetDerEncoded();
        }
예제 #4
0
 internal Asn1OctetString(
     Asn1Encodable obj)
 {
     try
     {
         this.str = obj.GetDerEncoded();
     }
     catch (IOException e)
     {
         throw new ArgumentException("Error processing object : " + e.ToString());
     }
 }
예제 #5
0
 internal Asn1OctetString(
     Asn1Encodable obj)
 {
     try
     {
         this.str = obj.GetDerEncoded();
     }
     catch (IOException e)
     {
         throw new ArgumentException("Error processing object : " + e.ToString());
     }
 }
		public DerApplicationSpecific(
			bool			isExplicit,
			int				tag,
			Asn1Encodable	obj)
		{
			byte[] data = obj.GetDerEncoded();

			this.isConstructed = isExplicit;
			this.tag = tag;

			if (isExplicit)
			{
				this.octets = data;
			}
			else
			{
				int lenBytes = GetLengthOfLength(data);
				byte[] tmp = new byte[data.Length - lenBytes];
				Array.Copy(data, lenBytes, tmp, 0, tmp.Length);
				this.octets = tmp;
			}
		}
        public DerApplicationSpecific(
            bool isExplicit,
            int tag,
            Asn1Encodable obj)
        {
            byte[] data = obj.GetDerEncoded();

            this.isConstructed = isExplicit;
            this.tag           = tag;

            if (isExplicit)
            {
                this.octets = data;
            }
            else
            {
                int    lenBytes = GetLengthOfLength(data);
                byte[] tmp      = new byte[data.Length - lenBytes];
                Array.Copy(data, lenBytes, tmp, 0, tmp.Length);
                this.octets = tmp;
            }
        }
예제 #8
0
 public DerBitString(
     Asn1Encodable obj)
 {
     this.data = obj.GetDerEncoded();
     //this.padBits = 0;
 }
예제 #9
0
		internal static byte[] GetSignatureForObject(
			DerObjectIdentifier		sigOid, // TODO Redundant now?
			string					sigName,
			AsymmetricKeyParameter	privateKey,
			SecureRandom			random,
			Asn1Encodable			ae)
		{
			if (sigOid == null)
				throw new ArgumentNullException("sigOid");

			ISigner sig = SignerUtilities.GetSigner(sigName);

			if (random != null)
			{
				sig.Init(true, new ParametersWithRandom(privateKey, random));
			}
			else
			{
				sig.Init(true, privateKey);
			}

			byte[] encoded = ae.GetDerEncoded();
			sig.BlockUpdate(encoded, 0, encoded.Length);

			return sig.GenerateSignature();
		}
예제 #10
0
 public DerBitString(
     Asn1Encodable obj)
 {
     this.data = obj.GetDerEncoded();
     //            this.padBits = 0;
 }
예제 #11
0
 public DerBitString(
     Asn1Encodable obj)
     : this(obj.GetDerEncoded())
 {
 }
예제 #12
0
		private static void WriteEncodable(MemoryStream ms, Asn1Encodable e)
		{
			if (e != null)
			{
				byte[] bs = e.GetDerEncoded();
				ms.Write(bs, 0, bs.Length);
			}
		}
예제 #13
0
        public DerBitString(
			Asn1Encodable obj)
            : this(obj.GetDerEncoded())
		{
		}
예제 #14
0
 public DerBitString(Asn1Encodable obj)
 {
     data = obj.GetDerEncoded();
 }