# DSAPublicKeySpec

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#pubctors)\|[Methods](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#inhmethods)  

# DSAPublicKeySpec

`
public


class
DSAPublicKeySpec
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[KeySpec](https://developer.android.com/reference/java/security/spec/KeySpec)`


`

|---|-------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.security.spec.DSAPublicKeySpec |

<br />

*** ** * ** ***

This class specifies a DSA public key with its associated parameters.  
**See also:**

- [Key](https://developer.android.com/reference/java/security/Key)
- [KeyFactory](https://developer.android.com/reference/java/security/KeyFactory)
- [KeySpec](https://developer.android.com/reference/java/security/spec/KeySpec)
- [DSAPrivateKeySpec](https://developer.android.com/reference/java/security/spec/DSAPrivateKeySpec)
- [X509EncodedKeySpec](https://developer.android.com/reference/java/security/spec/X509EncodedKeySpec)

## Summary

|                                                                                                                                                                                                                                                                                                   ### Public constructors                                                                                                                                                                                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DSAPublicKeySpec](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#DSAPublicKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger))`(`[BigInteger](https://developer.android.com/reference/java/math/BigInteger)` y, `[BigInteger](https://developer.android.com/reference/java/math/BigInteger)` p, `[BigInteger](https://developer.android.com/reference/java/math/BigInteger)` q, `[BigInteger](https://developer.android.com/reference/java/math/BigInteger)` g) ` Creates a new DSAPublicKeySpec with the specified parameter values. |

|                                                                                              ### Public methods                                                                                              ||
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| ` `[BigInteger](https://developer.android.com/reference/java/math/BigInteger) | ` `[getG](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#getG())`() ` Returns the base`g`.       |
| ` `[BigInteger](https://developer.android.com/reference/java/math/BigInteger) | ` `[getP](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#getP())`() ` Returns the prime`p`.      |
| ` `[BigInteger](https://developer.android.com/reference/java/math/BigInteger) | ` `[getQ](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#getQ())`() ` Returns the sub-prime`q`.  |
| ` `[BigInteger](https://developer.android.com/reference/java/math/BigInteger) | ` `[getY](https://developer.android.com/reference/java/security/spec/DSAPublicKeySpec#getY())`() ` Returns the public key`y`. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### DSAPublicKeySpec

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DSAPublicKeySpec (BigInteger y, 
                BigInteger p, 
                BigInteger q, 
                BigInteger g)
```

Creates a new DSAPublicKeySpec with the specified parameter values.

<br />

|                Parameters                 ||
|-----|--------------------------------------|
| `y` | `BigInteger`: the public key. <br /> |
| `p` | `BigInteger`: the prime. <br />      |
| `q` | `BigInteger`: the sub-prime. <br />  |
| `g` | `BigInteger`: the base. <br />       |

## Public methods

### getG

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public BigInteger getG ()
```

Returns the base`g`.

<br />

|                                             Returns                                             ||
|----------------------------------------------------------------------------|---------------------|
| [BigInteger](https://developer.android.com/reference/java/math/BigInteger) | the base`g`. <br /> |

### getP

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public BigInteger getP ()
```

Returns the prime`p`.

<br />

|                                             Returns                                              ||
|----------------------------------------------------------------------------|----------------------|
| [BigInteger](https://developer.android.com/reference/java/math/BigInteger) | the prime`p`. <br /> |

### getQ

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public BigInteger getQ ()
```

Returns the sub-prime`q`.

<br />

|                                               Returns                                                ||
|----------------------------------------------------------------------------|--------------------------|
| [BigInteger](https://developer.android.com/reference/java/math/BigInteger) | the sub-prime`q`. <br /> |

### getY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public BigInteger getY ()
```

Returns the public key`y`.

<br />

|                                                Returns                                                ||
|----------------------------------------------------------------------------|---------------------------|
| [BigInteger](https://developer.android.com/reference/java/math/BigInteger) | the public key`y`. <br /> |