internal byte[] BuildECCPublicBlob(EcDsaJsonWebKey jwk)
            {
                KeyBlobMagicNumber magic;
                KeySize            keySize;

                switch (jwk.m_curve)
                {
                case "P-256": {
                    magic   = KeyBlobMagicNumber.ECDSA_PUBLIC_P256;
                    keySize = KeySize.P256;
                    break;
                }

                case "P-384": {
                    magic   = KeyBlobMagicNumber.ECDSA_PUBLIC_P384;
                    keySize = KeySize.P384;
                    break;
                }

                case "P-521": {
                    magic   = KeyBlobMagicNumber.ECDSA_PUBLIC_P521;
                    keySize = KeySize.P521;
                    break;
                }

                default: {
                    throw new Exception("Unknown curve: " + jwk.m_curve);
                }
                }

                byte[] x = Base64UrlEncoder.DecodeBytes(jwk.m_x);
                x = FillBytes(x, (int)keySize);

                byte[] y = Base64UrlEncoder.DecodeBytes(jwk.m_y);
                y = FillBytes(y, (int)keySize);

                // Finally, lay out the structure itself
                byte[] blob = new byte[2 * sizeof(int) + x.Length + y.Length];

                int             offset         = 0;
                Func <int, int> increaseOffset = (size) => {
                    offset += size;
                    return(size);
                };

                Buffer.BlockCopy(BitConverter.GetBytes((int)magic), 0, blob, offset, increaseOffset(sizeof(int)));
                Buffer.BlockCopy(BitConverter.GetBytes(x.Length), 0, blob, offset, increaseOffset(sizeof(int)));
                Buffer.BlockCopy(x, 0, blob, offset, increaseOffset(x.Length));
                Buffer.BlockCopy(y, 0, blob, offset, increaseOffset(y.Length));

                return(blob);
            }
			internal byte[] BuildECCPublicBlob( EcDsaJsonWebKey jwk ) {
				KeyBlobMagicNumber magic;
				KeySize keySize;
				switch( jwk.m_curve ) {
					case "P-256": {
						magic = KeyBlobMagicNumber.ECDSA_PUBLIC_P256;
						keySize = KeySize.P256;
						break;
					}
					case "P-384": {
						magic = KeyBlobMagicNumber.ECDSA_PUBLIC_P384;
						keySize = KeySize.P384;
						break;
					}
					case "P-521": {
						magic = KeyBlobMagicNumber.ECDSA_PUBLIC_P521;
						keySize = KeySize.P521;
						break;
					}
					default: {
						throw new Exception( "Unknown curve: " + jwk.m_curve );
					}
				}

				byte[] x = Base64UrlEncoder.DecodeBytes( jwk.m_x );
				x = FillBytes( x, (int)keySize );

				byte[] y = Base64UrlEncoder.DecodeBytes( jwk.m_y );
				y = FillBytes( y, (int) keySize );

				// Finally, lay out the structure itself
				byte[] blob = new byte[2 * sizeof(int) + x.Length + y.Length];

				int offset = 0;
				Func<int, int> increaseOffset = ( size ) => {
					offset += size;
					return size;
				};

				Buffer.BlockCopy(BitConverter.GetBytes((int)magic), 0, blob, offset, increaseOffset(sizeof(int)));
				Buffer.BlockCopy(BitConverter.GetBytes(x.Length), 0, blob, offset, increaseOffset(sizeof(int)));
				Buffer.BlockCopy(x, 0, blob, offset, increaseOffset(x.Length));
				Buffer.BlockCopy(y, 0, blob, offset, increaseOffset(y.Length));

				return blob;
			}