Signature algorithm SHA 1-2 with ECDSA Can someone please explain what key sizes are required for the ECDSA algorithm?
I tried a 128 bit EC Key for SHA1withECDSA and it throws an error. However with 256 bit key I could run the algorithm. Therefore want to know what key sizes are required for the different ECDSA algorithm with SHA1 and SHA2. 

Also, how does the key size affect the signature here? Can you please explain?
Thank you.
In principle it should be possible to use 128 bit EC domain parameters / keys with any hash:

For Alice to sign a message m, she follows these steps:


Calculate $e = HASH(m)$, where $HASH$ is a cryptographic hash function, such as SHA-1.
Let $z$ be the $L_n$ leftmost bits of $e$, where $L_n$ is the bit length of the group order $n$.


Source: Wikipedia

However, implementations may reject combinations that would result in a very strange mix of security levels. Normally, I would try and use EC key sizes that are equal or larger than the digest algorithm used. It may be that some implementations refuse to perform step 2, only using the full hash instead of cutting it down to a smaller size.

Note that SHA-224, SHA-512/224 and SHA-384 kindly supply hash output sizes that can be combined with 224 and 384 bit ECC. Please have a look at keylength.com for more information about choosing matching sizes for algorithms.