I found that it is probably not possible to sign own Gradle plugin by jarsigner.
Because when I did it this plugin cause this crash
class "com.mycompany.gradle.buildplugin.PluginExtension_Decorated"'s signer information does not match signer information of other classes in the same package
If I understand it. JVM itself prevent to have classes signed by different signature in the same package. And also signed and unsigned one in the same package. So JVM itself doesn’t allow Gradle to dynamically create a new class in the same package.